<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>HEADWORQ</title>
	<atom:link href="https://headworq.de/en/feed/" rel="self" type="application/rss+xml" />
	<link>https://headworq.de/en</link>
	<description>Web Design &#38; Hosting</description>
	<lastBuildDate>Mon, 11 Nov 2024 15:44:40 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updateperiod>
	hourly	</sy:updateperiod>
	<sy:updatefrequency>
	1	</sy:updatefrequency>
	<generator>https://wordpress.org/?v=7.0</generator>

<image>
	<url>https://headworq.de/wp-content/uploads/2023/07/cropped-HWRQ-Logo-32x32.png</url>
	<title>HEADWORQ</title>
	<link>https://headworq.de/en</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Installing WireGuard Server on Ubuntu</title>
		<link>https://headworq.de/en/installing-wireguard-server-on-ubuntu/</link>
		
		<dc:creator><![CDATA[lucas.wiese2000]]></dc:creator>
		<pubDate>Mon, 11 Nov 2024 15:40:25 +0000</pubDate>
				<category><![CDATA[Ubuntu Server]]></category>
		<guid ispermalink="false">https://headworq.de/?p=4402</guid>

					<description><![CDATA[<p>WireGuard is a modern, fast, and secure VPN protocol that has been gaining widespread adoption due to its simplicity and performance. While WireGuard offers excellent security and speed, it lacks a built-in graphical user interface (GUI) for managing configurations and client connections. This is where WG-Easy comes in. WG-Easy is a powerful tool that provides [&#8230;]</p>
<p>The post <a href="https://headworq.de/en/installing-wireguard-server-on-ubuntu/">Installing WireGuard Server on Ubuntu</a> first appeared on <a href="https://headworq.de/en">HEADWORQ</a>.</p>]]></description>
										<content:encoded><![CDATA[<p class="wp-block-paragraph">WireGuard is a modern, fast, and secure VPN protocol that has been gaining widespread adoption due to its simplicity and performance. While WireGuard offers excellent security and speed, it lacks a built-in graphical user interface (GUI) for managing configurations and client connections. This is where <strong>WG-Easy</strong> comes in.</p>



<p class="wp-block-paragraph">WG-Easy is a powerful tool that provides an intuitive web-based GUI for managing a WireGuard server. It makes it easier for both beginners and experienced users to deploy and maintain a WireGuard VPN. This guide will walk you through the installation of WireGuard with WG-Easy, including setting up the server, creating and managing clients, and configuring advanced features.</p>



<p class="wp-block-paragraph">Let’s dive into the process!</p>



<h2 class="wp-block-heading">What is WG-Easy?</h2>



<p class="wp-block-paragraph"><a href="https://github.com/wg-easy/wg-easy">WG-Easy</a> is an all-in-one solution for setting up and managing WireGuard VPN servers with a simple web interface. Some of its core features include:</p>



<ul class="wp-block-list">
<li><strong>WireGuard + Web UI</strong>: Install and manage WireGuard and its configurations through a simple web interface.</li>



<li><strong>Client Management</strong>: Add, remove, and manage VPN clients easily.</li>



<li><strong>Statistics</strong>: Monitor the traffic (Tx/Rx) for each connected client.</li>



<li><strong>Prometheus Metrics</strong>: Integration with Prometheus for advanced monitoring and reporting.</li>



<li><strong>Multilingual Support</strong>: The interface supports multiple languages, including English, German, French, Spanish, and more.</li>



<li><strong>Dark Mode</strong>: Automatically switch to dark mode depending on your preferences.</li>
</ul>



<p class="wp-block-paragraph">If you want to quickly set up WireGuard and manage it without needing to dive into configuration files or CLI commands, WG-Easy is the perfect solution.</p>



<h2 class="wp-block-heading">Prerequisites</h2>



<p class="wp-block-paragraph">Before you begin, ensure you meet the following requirements:</p>



<ol class="wp-block-list">
<li><strong>A server with Docker installed</strong>: Docker is required to run WG-Easy in a containerized environment.</li>



<li><strong>A Linux host</strong>: Any modern Linux distribution should work as long as it has a kernel that supports WireGuard.</li>



<li><strong>A public IP address or Dynamic DNS (DDNS) hostname</strong>: The WireGuard server needs to be accessible from the internet.</li>



<li><strong>Basic understanding of WireGuard</strong>: If you&#8217;re not familiar with WireGuard, it’s a good idea to learn the basics of how it works.</li>
</ol>



<p class="wp-block-paragraph">If you don’t have Docker installed, start by installing it on your server:</p>



<pre class="wp-block-code"><code>curl -sSL https://get.docker.com | sh
sudo usermod -aG docker $(whoami)
exit</code></pre>



<p class="wp-block-paragraph">After running the commands above, log back in to ensure your user is added to the Docker group.</p>



<h2 class="wp-block-heading">Installing WG-Easy with Docker</h2>



<h3 class="wp-block-heading">Step 1: Prepare Your Environment</h3>



<p class="wp-block-paragraph">Now that Docker is installed, you can proceed with installing WG-Easy. This will be done using Docker, which simplifies deployment and management of the application.</p>



<ol class="wp-block-list">
<li><strong>Run the Docker Container</strong><br>Run the following command to pull and start the WG-Easy container:</li>
</ol>



<pre class="wp-block-code"><code>docker run --detach \
  --name wg-easy \
  --env LANG=en \
  --env WG_HOST=&lt;YOUR_SERVER_IP&gt; \
  --env PASSWORD_HASH='&lt;YOUR_ADMIN_PASSWORD_HASH&gt;' \
  --env PORT=51821 \
  --env WG_PORT=51820 \
  --volume ~/.wg-easy:/etc/wireguard \
  --publish 51820:51820/udp \
  --publish 51821:51821/tcp \
  --cap-add NET_ADMIN \
  --cap-add SYS_MODULE \
  --sysctl 'net.ipv4.conf.all.src_valid_mark=1' \
  --sysctl 'net.ipv4.ip_forward=1' \
  --restart unless-stopped \
  ghcr.io/wg-easy/wg-easy</code></pre>



<h3 class="wp-block-heading">Step 2: Configure the Environment Variables</h3>



<p class="wp-block-paragraph">In the above command, replace the placeholders with your specific details:</p>



<ul class="wp-block-list">
<li><code>&lt;YOUR_SERVER_IP></code>: Replace with your public server IP or DDNS hostname.</li>



<li><code>&lt;YOUR_ADMIN_PASSWORD_HASH></code>: A bcrypt hashed password to secure access to the Web UI. For security, don’t use plain text passwords. You can generate the hash using online tools or command-line utilities.</li>
</ul>



<p class="wp-block-paragraph">To generate a bcrypt hash, use the following command:</p>



<pre class="wp-block-code"><code># On a Linux/Mac terminal
openssl passwd -6</code></pre>



<p class="wp-block-paragraph">Or use online bcrypt hash generators.</p>



<h3 class="wp-block-heading">Step 3: Access the Web UI</h3>



<p class="wp-block-paragraph">Once the container is up and running, you can access the WG-Easy web interface by visiting:</p>



<pre class="wp-block-code"><code>http:&#47;&#47;&lt;YOUR_SERVER_IP&gt;:51821</code></pre>



<p class="wp-block-paragraph">The default port for the web UI is 51821. Here, you&#8217;ll be prompted to log in using the bcrypt password hash you generated earlier.</p>



<h3 class="wp-block-heading">Step 4: Client Configuration and Management</h3>



<p class="wp-block-paragraph">Once logged in, you can start managing your WireGuard clients. The web interface provides options to:</p>



<ul class="wp-block-list">
<li><strong>Create Clients</strong>: Add new WireGuard clients by filling out simple forms. Each client will have a unique QR code and configuration file that can be downloaded and used on a mobile device or desktop WireGuard client.</li>



<li><strong>List Clients</strong>: View all clients currently configured on your WireGuard server.</li>



<li><strong>Edit/Delete Clients</strong>: Modify or remove client configurations as necessary.</li>



<li><strong>Enable/Disable Clients</strong>: Toggle client access to the VPN.</li>



<li><strong>Statistics</strong>: Monitor real-time data usage (Tx/Rx) for each client and see which clients are currently connected.</li>
</ul>



<p class="wp-block-paragraph">The web interface is highly intuitive, and most users will find that they don’t need to manually edit WireGuard configuration files anymore.</p>



<h2 class="wp-block-heading">Advanced Configuration Options</h2>



<h3 class="wp-block-heading">1. Prometheus Metrics</h3>



<p class="wp-block-paragraph">WG-Easy provides integration with Prometheus for collecting and monitoring various WireGuard metrics. To enable Prometheus metrics, set the following environment variable in the Docker container:</p>



<pre class="wp-block-code"><code>--env ENABLE_PROMETHEUS_METRICS=true</code></pre>



<p class="wp-block-paragraph">This will expose metrics at the following endpoint:</p>



<pre class="wp-block-code"><code>http:&#47;&#47;&lt;YOUR_SERVER_IP&gt;:51821/metrics</code></pre>



<p class="wp-block-paragraph">You can use Grafana or other monitoring tools to visualize this data. For more advanced setups, check the <a href="https://prometheus.io/docs/introduction/overview/">Prometheus documentation</a>.</p>



<h3 class="wp-block-heading">2. Client Expiry Time</h3>



<p class="wp-block-paragraph">You can enable expiration dates for clients by setting the <code>WG_ENABLE_EXPIRES_TIME</code> environment variable:</p>



<pre class="wp-block-code"><code>--env WG_ENABLE_EXPIRES_TIME=true</code></pre>



<p class="wp-block-paragraph">This ensures that clients cannot access the VPN indefinitely. You can set specific expiration times for each client through the web UI.</p>



<h3 class="wp-block-heading">3. Traffic Statistics</h3>



<p class="wp-block-paragraph">By default, traffic statistics (Tx/Rx charts) are disabled. You can enable them by setting the following environment variable:</p>



<pre class="wp-block-code"><code>--env UI_TRAFFIC_STATS=true</code></pre>



<p class="wp-block-paragraph">This allows you to view detailed data usage for each client in real-time.</p>



<h3 class="wp-block-heading">4. One-Time Links</h3>



<p class="wp-block-paragraph">If you need to share client configuration files without worrying about security, you can enable one-time download links:</p>



<pre class="wp-block-code"><code>--env WG_ENABLE_ONE_TIME_LINKS=true</code></pre>



<p class="wp-block-paragraph">This generates temporary links that expire after five minutes, providing an extra layer of security.</p>



<h2 class="wp-block-heading">Updating WG-Easy</h2>



<p class="wp-block-paragraph">To keep WG-Easy up to date, you can easily pull the latest image from Docker Hub and restart the container. Here’s how to do it:</p>



<ol class="wp-block-list">
<li><strong>Stop the Current Container</strong>:</li>
</ol>



<pre class="wp-block-code"><code>docker stop wg-easy</code></pre>



<ol start="2" class="wp-block-list">
<li><strong>Remove the Old Container</strong>:</li>
</ol>



<pre class="wp-block-code"><code>docker rm wg-easy</code></pre>



<ol start="3" class="wp-block-list">
<li><strong>Pull the Latest Image</strong>:</li>
</ol>



<pre class="wp-block-code"><code>docker pull ghcr.io/wg-easy/wg-easy</code></pre>



<ol start="4" class="wp-block-list">
<li><strong>Restart the Container</strong>:</li>
</ol>



<p class="wp-block-paragraph">Run the same <code>docker run</code> command you used earlier to restart the container with the updated image.</p>



<p class="wp-block-paragraph">Alternatively, if you&#8217;re using Docker Compose, simply run:</p>



<pre class="wp-block-code"><code>docker-compose up --detach --pull always</code></pre>



<p class="wp-block-paragraph">This will automatically pull the latest image and recreate the container.</p>



<h2 class="wp-block-heading">Troubleshooting</h2>



<ul class="wp-block-list">
<li><strong>Unable to Access Web UI</strong>: Make sure your firewall is configured to allow traffic on port 51821 (TCP) and 51820 (UDP).</li>



<li><strong>WireGuard Not Connecting</strong>: Ensure that the WireGuard service is running on the host and that the server’s IP and port are correctly configured in the WG-Easy interface.</li>



<li><strong>Docker Issues</strong>: If Docker isn’t running correctly, check the Docker logs with <code>docker logs wg-easy</code> to diagnose any issues.</li>
</ul>



<h2 class="wp-block-heading">Conclusion</h2>



<p class="wp-block-paragraph">Setting up a WireGuard server with WG-Easy is a straightforward process that can save you time and effort managing your VPN. Whether you&#8217;re a home user looking for a secure VPN connection or a system administrator managing a network of clients, WG-Easy makes the process simple and accessible through a web-based GUI. By leveraging Docker and a few easy-to-configure environment variables, you can deploy and maintain a robust VPN server with minimal hassle.</p>



<p class="wp-block-paragraph">For more details, visit the <a href="https://github.com/wg-easy/wg-easy">WG-Easy GitHub repository</a>, which includes a wealth of information on configuration, advanced use cases, and troubleshooting.</p>



<p class="wp-block-paragraph">Happy VPNing!</p><p>The post <a href="https://headworq.de/en/installing-wireguard-server-on-ubuntu/">Installing WireGuard Server on Ubuntu</a> first appeared on <a href="https://headworq.de/en">HEADWORQ</a>.</p>]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>