mirror of https://github.com/wg-easy/wg-easy
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
48 KiB
1 lines
48 KiB
{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"Welcome to the Documentation for <code>wg-easy</code>","text":"<p>\u00a0This Documentation is Versioned</p> <p>Make sure to select the correct version of this documentation! It should match the version of the image you are using. The default version corresponds to the <code>:latest</code> image tag - the most recent stable release.</p> <p>This documentation provides you not only with the basic setup and configuration of <code>wg-easy</code> but also with advanced configuration, elaborate usage scenarios, detailed examples, hints and more.</p>"},{"location":"#about","title":"About","text":"<p><code>wg-easy</code> is the easiest way to run WireGuard VPN + Web-based Admin UI.</p>"},{"location":"#contents","title":"Contents","text":""},{"location":"#getting-started","title":"Getting Started","text":"<p>If you're new to wg-easy, make sure to read the Getting Started chapter first. If you want to look at examples for Docker Run and Compose, we have an Examples page.</p>"},{"location":"#contributing","title":"Contributing","text":"<p>We are always happy to welcome new contributors. For guidelines and entrypoints please have a look at the Contributing section.</p>"},{"location":"#migration","title":"Migration","text":"<p>If you are migrating from an older version of <code>wg-easy</code>, please read the Migration chapter.</p>"},{"location":"faq/","title":"FAQ","text":"<p>Here are some frequently asked questions or errors about <code>wg-easy</code>. If you have a question that is not answered here, please feel free to open a discussion on GitHub.</p>"},{"location":"faq/#error-wireguard-exited-with-the-error-cannot-find-device-wg0","title":"Error: WireGuard exited with the error: Cannot find device \"wg0\"","text":"<p>This error indicates that the WireGuard interface <code>wg0</code> does not exist. This can happen if the WireGuard kernel module is not loaded or if the interface was not created properly.</p> <p>To resolve this issue, you can try the following steps:</p> <ol> <li> <p>Load the WireGuard kernel module: If the WireGuard kernel module is not loaded, you can load it manually by running:</p> <pre><code>sudo modprobe wireguard\n</code></pre> </li> <li> <p>Load the WireGuard kernel module on boot: If you want to ensure that the WireGuard kernel module is loaded automatically on boot, you can add it to the <code>/etc/modules</code> file:</p> <pre><code>echo \"wireguard\" | sudo tee -a /etc/modules\n</code></pre> </li> </ol>"},{"location":"faq/#cant-initialize-iptables-table-nat-table-does-not-exist-do-you-need-to-insmod","title":"can't initialize iptables table `nat': Table does not exist (do you need to insmod?)","text":"<p>This error indicates that the <code>nat</code> table in <code>iptables</code> does not exist. This can happen if the <code>iptables</code> kernel module is not loaded or if the <code>nat</code> table is not supported by your kernel.</p> <p>To resolve this issue, you can try the following steps:</p> <ol> <li> <p>Load the <code>nat</code> kernel module: If the <code>nat</code> kernel module is not loaded, you can load it manually by running:</p> <pre><code>sudo modprobe iptable_nat\n</code></pre> </li> <li> <p>Load the <code>nat</code> kernel module on boot: If you want to ensure that the <code>nat</code> kernel module is loaded automatically on boot, you can add it to the <code>/etc/modules</code> file:</p> <pre><code> echo \"iptable_nat\" | sudo tee -a /etc/modules\n</code></pre> </li> </ol>"},{"location":"faq/#cant-initialize-ip6tables-table-nat-table-does-not-exist-do-you-need-to-insmod","title":"can't initialize ip6tables table `nat': Table does not exist (do you need to insmod?)","text":"<p>This error indicates that the <code>nat</code> table in <code>ip6tables</code> does not exist. This can happen if the <code>ip6tables</code> kernel module is not loaded or if the <code>nat</code> table is not supported by your kernel.</p> <p>To resolve this issue, you can try the following steps:</p> <ol> <li> <p>Load the <code>nat</code> kernel module: If the <code>nat</code> kernel module is not loaded, you can load it manually by running:</p> <pre><code>sudo modprobe ip6table_nat\n</code></pre> </li> <li> <p>Load the <code>nat</code> kernel module on boot: If you want to ensure that the <code>nat</code> kernel module is loaded automatically on boot, you can add it to the <code>/etc/modules</code> file:</p> <pre><code> echo \"ip6table_nat\" | sudo tee -a /etc/modules\n</code></pre> </li> </ol>"},{"location":"faq/#cant-initialize-iptables-table-filter-permission-denied","title":"can't initialize iptables table `filter': Permission denied","text":"<p>This error indicates that the <code>filter</code> table in <code>iptables</code> cannot be initialized due to permission issues. This can happen if you are not running the command with sufficient privileges.</p> <p>To resolve this issue, you can try the following steps:</p> <ol> <li> <p>Load the <code>filter</code> kernel module: If the <code>filter</code> kernel module is not loaded, you can load it manually by running:</p> <pre><code>sudo modprobe iptable_filter\n</code></pre> </li> <li> <p>Load the <code>filter</code> kernel module on boot: If you want to ensure that the <code>filter</code> kernel module is loaded automatically on boot, you can add it to the <code>/etc/modules</code> file:</p> <pre><code>echo \"iptable_filter\" | sudo tee -a /etc/modules\n</code></pre> </li> </ol>"},{"location":"faq/#cant-initialize-ip6tables-table-filter-permission-denied","title":"can't initialize ip6tables table `filter': Permission denied","text":"<p>This error indicates that the <code>filter</code> table in <code>ip6tables</code> cannot be initialized due to permission issues. This can happen if you are not running the command with sufficient privileges.</p> <p>To resolve this issue, you can try the following steps:</p> <ol> <li> <p>Load the <code>filter</code> kernel module: If the <code>filter</code> kernel module is not loaded, you can load it manually by running:</p> <pre><code>sudo modprobe ip6table_filter\n</code></pre> </li> <li> <p>Load the <code>filter</code> kernel module on boot: If you want to ensure that the <code>filter</code> kernel module is loaded automatically on boot, you can add it to the <code>/etc/modules</code> file:</p> <pre><code> echo \"ip6table_filter\" | sudo tee -a /etc/modules\n</code></pre> </li> </ol>"},{"location":"getting-started/","title":"Getting Started","text":"<p>This page explains how to get started with <code>wg-easy</code>. The guide uses Docker Compose as a reference. In our examples, we mount the named volume <code>etc_wireguard</code> to <code>/etc/wireguard</code> inside the container.</p>"},{"location":"getting-started/#preliminary-steps","title":"Preliminary Steps","text":"<p>Before you can get started with deploying your own VPN, there are some requirements to be met:</p> <ol> <li>You need to have a host that you can manage</li> <li>You need to have a domain name or a public IP address</li> <li>You need a supported architecture (x86_64, arm64, armv7)</li> </ol>"},{"location":"getting-started/#host-setup","title":"Host Setup","text":"<p>There are a few requirements for a suitable host system:</p> <ol> <li>You need to have a container runtime installed</li> </ol> <p>About the Container Runtime</p> <p>On the host, you need to have a suitable container runtime (like Docker or Podman) installed. We assume Docker Compose is installed. We have aligned file names and configuration conventions with the latest Docker Compose specification. If you're using podman, make sure to read the related documentation.</p>"},{"location":"getting-started/#deploying-the-actual-image","title":"Deploying the Actual Image","text":""},{"location":"getting-started/#tagging-convention","title":"Tagging Convention","text":"<p>To understand which tags you should use, read this section carefully. Our CI will automatically build, test and push new images to the following container registry:</p> <ol> <li>GitHub Container Registry (<code>ghcr.io/wg-easy/wg-easy</code>)</li> </ol> <p>All workflows are using the tagging convention listed below. It is subsequently applied to all images.</p> tag Type Example Description <code>15</code> latest minor for that major tag <code>ghcr.io/wg-easy/wg-easy:15</code> latest features for specific major versions, no breaking changes, recommended <code>latest</code> latest tag <code>ghcr.io/wg-easy/wg-easy:latest</code> or <code>ghcr.io/wg-easy/wg-easy</code> points to latest release, can include breaking changes <code>15.0</code> latest patch for that minor tag <code>ghcr.io/wg-easy/wg-easy:15.0</code> latest patches for specific minor version <code>15.0.0</code> specific tag <code>ghcr.io/wg-easy/wg-easy:15.0.0</code> specific release, no updates <code>edge</code> push to <code>master</code> <code>ghcr.io/wg-easy/wg-easy:edge</code> mostly unstable, gets frequent package and code updates <code>development</code> pull requests <code>ghcr.io/wg-easy/wg-easy:development</code> used for development, testing code from PRs <p>When publishing a tag we follow the Semantic Versioning specification. The <code>latest</code> tag is always pointing to the latest stable release. If you want to avoid breaking changes, use the major version tag (e.g. <code>15</code>).</p>"},{"location":"getting-started/#follow-tutorials","title":"Follow tutorials","text":"<ul> <li>Basic Installation with Docker Compose (Recommended)</li> <li>Simple Installation with Docker Run</li> <li>Advanced Installation with Podman</li> </ul> <p>Use the Correct Commands For Stopping and Starting <code>wg-easy</code></p> <p>Use <code>sudo docker compose up / down</code>, not <code>sudo docker compose start / stop</code>. Otherwise, the container is not properly destroyed and you may experience problems during startup because of inconsistent state.</p> <p>That's it! It really is that easy.</p>"},{"location":"advanced/api/","title":"API","text":"<p>Breaking Changes</p> <p>This API is not yet stable and may change in the future. The API is currently in development and is subject to change without notice. The API is not yet documented, but we will add documentation as the API stabilizes.</p> <p>You can use the API to interact with the application programmatically. The API is available at <code>/api</code> and supports both GET and POST requests. The API is designed to be simple and easy to use, with a focus on providing a consistent interface for all endpoints.</p> <p>There is no documentation for the API yet, but this will be added as the underlying library supports it.</p>"},{"location":"advanced/api/#authentication","title":"Authentication","text":"<p>To use the API, you need to authenticate using Basic Authentication. The username and password are the same as the ones you use to log in to the web application. If you use 2FA, the API will not work. You need to disable 2FA in the web application to use the API.</p>"},{"location":"advanced/api/#authentication-example","title":"Authentication Example","text":"<pre><code>import requests\nfrom requests.auth import HTTPBasicAuth\n\nurl = \"https://example.com:51821/api/client\"\nresponse = requests.get(url, auth=HTTPBasicAuth('username', 'password'))\nif response.status_code == 200:\n data = response.json()\n print(data)\nelse:\n print(f\"Error: {response.status_code}\")\n</code></pre>"},{"location":"advanced/api/#endpoints","title":"Endpoints","text":"<p>The Endpoints are not yet documented. But as file-based routing is used, you can find the endpoints in the <code>src/server/api</code> folder. The method is defined in the file name.</p>"},{"location":"advanced/api/#endpoints-example","title":"Endpoints Example","text":"File Name Endpoint Method <code>src/server/api/client.get.ts</code> <code>/api/client</code> GET <code>src/server/api/setup/2.post.ts</code> <code>/api/setup/2</code> POST"},{"location":"advanced/config/optional-config/","title":"Optional Configuration","text":"<p>You can set these environment variables to configure the container. They are not required, but can be useful in some cases.</p> Env Default Example Description <code>PORT</code> <code>51821</code> <code>6789</code> TCP port for Web UI. <code>HOST</code> <code>0.0.0.0</code> <code>localhost</code> IP address web UI binds to. <code>INSECURE</code> <code>false</code> <code>true</code> If access over http is allowed <code>DISABLE_IPV6</code> <code>false</code> <code>true</code> If IPv6 support should be disabled <p>IPv6 Caveats</p> <p>Disabling IPv6 will disable the creation of the default IPv6 firewall rules and won't add a IPv6 address to the interface and clients.</p> <p>You will however still see a IPv6 address in the Web UI, but it won't be used.</p> <p>This option can be removed in the future, as more devices support IPv6.</p>"},{"location":"advanced/config/unattended-setup/","title":"Unattended Setup","text":"<p>If you want to run the setup without any user interaction, e.g. with a tool like Ansible, you can use these environment variables to configure the setup.</p> <p>These will only be used during the first start of the container. After that, the setup will be disabled.</p> Env Example Description Group <code>INIT_ENABLED</code> <code>true</code> Enables the below env vars 0 <code>INIT_USERNAME</code> <code>admin</code> Sets admin username 1 <code>INIT_PASSWORD</code> <code>Se!ureP%ssw</code> Sets admin password 1 <code>INIT_HOST</code> <code>vpn.example.com</code> Host clients will connect to 1 <code>INIT_PORT</code> <code>51820</code> Port clients will connect to and wireguard will listen on 1 <code>INIT_DNS</code> <code>1.1.1.1,8.8.8.8</code> Sets global dns setting 2 <code>INIT_IPV4_CIDR</code> <code>10.8.0.0/24</code> Sets IPv4 cidr 3 <code>INIT_IPV6_CIDR</code> <code>2001:0DB8::/32</code> Sets IPv6 cidr 3 <p>\u00a0Variables have to be used together</p> <p>If variables are in the same group, you have to set all of them. For example, if you set <code>INIT_IPV4_CIDR</code>, you also have to set <code>INIT_IPV6_CIDR</code>.</p> <p>If you want to skip the setup process, you have to configure group <code>1</code></p> <p>Security</p> <p>The initial username and password is not checked for complexity. Make sure to set a long enough username and password. Otherwise, the user won't be able to log in.</p> <p>It's recommended to remove the variables after the setup is done to prevent the password from being exposed.</p>"},{"location":"advanced/metrics/prometheus/","title":"Prometheus","text":"<p>To monitor the WireGuard server, you can use Prometheus and Grafana. The container exposes a <code>/metrics/prometheus</code> endpoint that can be scraped by Prometheus.</p>"},{"location":"advanced/metrics/prometheus/#enable-prometheus","title":"Enable Prometheus","text":"<p>To enable Prometheus metrics, go to Admin Panel > General and enable Prometheus.</p> <p>You can optionally set a Bearer Password for the metrics endpoints. This is useful if you want to expose the metrics endpoint to the internet.</p>"},{"location":"advanced/metrics/prometheus/#configure-prometheus","title":"Configure Prometheus","text":"<p>You need to add a scrape config to your Prometheus configuration file. Here is an example:</p> <pre><code>scrape_configs:\n - job_name: 'wg-easy'\n scrape_interval: 30s\n metrics_path: /metrics/prometheus\n static_configs:\n - targets:\n - 'localhost:51821'\n authorization:\n type: Bearer\n credentials: 'SuperSecurePassword'\n</code></pre>"},{"location":"advanced/metrics/prometheus/#grafana-dashboard","title":"Grafana Dashboard","text":"<p>You can use the following Grafana dashboard to visualize the metrics:</p> <p></p> <p>21733</p> <p>Unofficial</p> <p>The Grafana dashboard is not official and is not maintained by the <code>wg-easy</code> team. If you have any issues with the dashboard, please contact the author of the dashboard. See #1299 for more information.</p>"},{"location":"advanced/migrate/","title":"Migrate","text":"<p>If you want to migrate from an older version of <code>wg-easy</code> to the new version, you can find the migration guides listed below.</p> <ul> <li>Migrate from v14 to v15 : This guide should also work for any version before <code>v14</code>.</li> </ul>"},{"location":"advanced/migrate/from-14-to-15/","title":"Migrate from v14 to v15","text":"<p>This guide will help you migrate from <code>v14</code> to version <code>v15</code> of <code>wg-easy</code>.</p>"},{"location":"advanced/migrate/from-14-to-15/#changes","title":"Changes","text":"<ul> <li>This is a complete rewrite of the <code>wg-easy</code> project, therefore the configuration files and the way you interact with the project have changed.</li> <li>If you use armv6, you unfortunately won't be able to migrate to <code>v15</code>.</li> <li>If you are connecting to the Web UI via HTTP, you need to set the <code>INSECURE</code> environment variable to <code>true</code> in the new container.</li> </ul>"},{"location":"advanced/migrate/from-14-to-15/#migration","title":"Migration","text":""},{"location":"advanced/migrate/from-14-to-15/#backup","title":"Backup","text":"<p>Before you start the migration, make sure to back up your existing configuration files.</p> <p>Go into the Web UI and click the Backup button, this should download a <code>wg0.json</code> file.</p> <p>Or download the <code>wg0.json</code> file from your container volume to your pc.</p> <p>You will need this file for the migration</p> <p>You will also need to back up the old environment variables you set for the container, as they will not be automatically migrated.</p>"},{"location":"advanced/migrate/from-14-to-15/#remove-old-container","title":"Remove old container","text":"<ol> <li>Stop the running container</li> </ol> <p>If you are using <code>docker run</code></p> <pre><code>docker stop wg-easy\n</code></pre> <p>If you are using <code>docker compose</code></p> <pre><code>docker compose down\n</code></pre>"},{"location":"advanced/migrate/from-14-to-15/#start-new-container","title":"Start new container","text":"<p>Follow the instructions in the Getting Started or Basic Installation guide to start the new container.</p> <p>In the setup wizard, select that you already have a configuration file and upload the <code>wg0.json</code> file you downloaded in the backup step.</p>"},{"location":"advanced/migrate/from-14-to-15/#environment-variables","title":"Environment Variables","text":"<p>v15 does not use the same environment variables as v14, most of them have been moved to the Admin Panel in the Web UI.</p>"},{"location":"advanced/migrate/from-14-to-15/#done","title":"Done","text":"<p>You have now successfully migrated to <code>v15</code> of <code>wg-easy</code>.</p>"},{"location":"contributing/general/","title":"General Information","text":""},{"location":"contributing/general/#coding-style","title":"Coding Style","text":"<p>When refactoring, writing or altering files, adhere to these rules:</p> <ol> <li>Adjust your style of coding to the style that is already present! Even if you do not like it, this is due to consistency. There was a lot of work involved in making all files consistent.</li> <li>Use <code>pnpm lint</code> to check your scripts! Your contributions are checked by GitHub Actions too, so you will need to do this.</li> <li>Use the provided <code>.vscode/settings.json</code> file.</li> </ol>"},{"location":"contributing/general/#documentation","title":"Documentation","text":"<p>Make sure to select <code>edge</code> in the dropdown menu at the top. Navigate to the page you would like to edit and click the edit button in the top right. This allows you to make changes and create a pull-request.</p> <p>Alternatively you can make the changes locally. For that you'll need to have Docker installed. Run</p> <pre><code>pnpm docs:serve\n</code></pre> <p>This serves the documentation on your local machine on port <code>8080</code>. Each change will be hot-reloaded onto the page you view, just edit, save and look at the result.</p>"},{"location":"contributing/issues-and-pull-requests/","title":"Issues and Pull Requests","text":"<p>This project is Open Source. That means that you can contribute on enhancements, bug fixing or improving the documentation.</p>"},{"location":"contributing/issues-and-pull-requests/#opening-an-issue","title":"Opening an Issue","text":"<p>Attention</p> <p>Before opening an issue, read the <code>README</code> carefully, study the docs for your version (maybe latest) and your search engine you trust. The issue tracker is not meant to be used for unrelated questions!</p> <p>When opening an issue, please provide details use case to let the community reproduce your problem.</p> <p>Attention</p> <p>Use the issue templates to provide the necessary information. Issues which do not use these templates are not worked on and closed.</p> <p>By raising issues, I agree to these terms and I understand, that the rules set for the issue tracker will help both maintainers as well as everyone to find a solution.</p> <p>Maintainers take the time to improve on this project and help by solving issues together. It is therefore expected from others to make an effort and comply with the rules.</p>"},{"location":"contributing/issues-and-pull-requests/#filing-a-bug-report","title":"Filing a Bug Report","text":"<p>Thank you for participating in this project and reporting a bug. <code>wg-easy</code> is a community-driven project, and each contribution counts!</p> <p>Maintainers and moderators are volunteers. We greatly appreciate reports that take the time to provide detailed information via the template, enabling us to help you in the best and quickest way. Ignoring the template provided may seem easier, but discourages receiving any support.</p> <p>Markdown formatting can be used in almost all text fields (unless stated otherwise in the description).</p> <p>Be as precise as possible, and if in doubt, it's best to add more information that too few.</p> <p>When an option is marked with \"not officially supported\" / \"unsupported\", then support is dependent on availability from specific maintainers.</p>"},{"location":"contributing/issues-and-pull-requests/#pull-requests","title":"Pull Requests","text":"<p>Motivation</p> <p>You want to add a feature? Feel free to start creating an issue explaining what you want to do and how you're thinking doing it. Other users may have the same need and collaboration may lead to better results.</p>"},{"location":"contributing/issues-and-pull-requests/#submit-a-pull-request","title":"Submit a Pull-Request","text":"<p>The development workflow is the following:</p> <ol> <li>Fork the project</li> <li>Write the code that is needed :D</li> <li>Document your improvements if necessary</li> <li>Commit (and sign your commit), push and create a pull-request to merge into <code>master</code>. Please use the pull-request template to provide a minimum of contextual information and make sure to meet the requirements of the checklist.</li> </ol> <p>Pull requests are automatically tested against the CI and will be reviewed when tests pass. When your changes are validated, your branch is merged. CI builds the new <code>:edge</code> image on every push to the <code>master</code> branch and your changes will be included in the next version release.</p>"},{"location":"contributing/translation/","title":"Translation","text":"<p>This project supports multiple languages. If you would like to contribute a translation, please follow these steps:</p>"},{"location":"contributing/translation/#add-new-translation","title":"Add new Translation","text":"<p>Create a new file in <code>src/i18n/locales</code>. Name it <code><locale_code>.json</code> (e.g. <code>fr.json</code> for French).</p> <p>Import and add the newly created file in <code>src/i18n/i18n.config.ts</code>.</p> <p>Add your language in the <code>src/nuxt.config.ts</code> file. You have to specify code, language and name.</p> <p><code>code</code> is the name of the translation file without the extension (e.g. <code>fr</code> for <code>fr.json</code>).</p> <p><code>language</code> is the BCP 47 language tag with region (e.g. <code>fr-FR</code> for French). See www.lingoes.net for a list of language codes.</p> <p><code>name</code> is the display name of the language (e.g. <code>Fran\u00e7ais</code> for French).</p>"},{"location":"contributing/translation/#update-existing-translation","title":"Update existing Translation","text":"<p>If you need to update an existing translation, simply edit the corresponding <code><locale_code>.json</code> file in <code>src/i18n/locales</code>.</p>"},{"location":"contributing/translation/#contribute-changes","title":"Contribute changes","text":"<p>See Pull Requests on how to contribute your translation.</p>"},{"location":"examples/tutorials/adguard/","title":"AdGuard Home","text":"<p>It seems like the Docs on how to setup AdGuard Home are not available yet.</p> <p>Feel free to create a PR and add them here.</p>"},{"location":"examples/tutorials/auto-updates/","title":"Auto Updates","text":""},{"location":"examples/tutorials/auto-updates/#docker-compose","title":"Docker Compose","text":"<p>With Docker Compose <code>wg-easy</code> can be updated with a single command:</p> <pre><code>cd /etc/docker/containers/wg-easy\nsudo docker compose up -d --pull always\n</code></pre>"},{"location":"examples/tutorials/auto-updates/#watchtower","title":"Watchtower","text":"<p>If you want the updates to be fully automatic you can install Watchtower. This will check for updates every day at 4:00 AM and update the container if a new version is available.</p> <p>File: <code>/etc/docker/containers/watchtower/docker-compose.yml</code></p> <pre><code>services:\n watchtower:\n image: containrrr/watchtower:latest\n volumes:\n - /var/run/docker.sock:/var/run/docker.sock\n env_file:\n - watchtower.env\n restart: unless-stopped\n</code></pre> <p>File: <code>/etc/docker/containers/watchtower/watchtower.env</code></p> <pre><code>WATCHTOWER_CLEANUP=true\nWATCHTOWER_SCHEDULE=0 0 4 * * *\nTZ=Europe/Berlin\n\n# Email\n# WATCHTOWER_NOTIFICATIONS_LEVEL=info\n# WATCHTOWER_NOTIFICATIONS=email\n# WATCHTOWER_NOTIFICATION_EMAIL_FROM=mail@example.com\n# WATCHTOWER_NOTIFICATION_EMAIL_TO=mail@example.com\n# WATCHTOWER_NOTIFICATION_EMAIL_SERVER=smtp.example.com\n# WATCHTOWER_NOTIFICATION_EMAIL_SERVER_USER=mail@example.com\n# WATCHTOWER_NOTIFICATION_EMAIL_SERVER_PASSWORD=\"SuperSecurePassword\"\n# WATCHTOWER_NOTIFICATION_EMAIL_SERVER_PORT=587\n</code></pre> <pre><code>cd /etc/docker/containers/watchtower\nsudo docker compose up -d\n</code></pre>"},{"location":"examples/tutorials/auto-updates/#docker-run","title":"Docker Run","text":"<pre><code>sudo docker stop wg-easy\nsudo docker rm wg-easy\nsudo docker pull ghcr.io/wg-easy/wg-easy\n</code></pre> <p>And then run the <code>docker run -d \\ ...</code> command from Docker Run again.</p>"},{"location":"examples/tutorials/auto-updates/#podman","title":"Podman","text":"<p>To update <code>wg-easy</code> (and every container that has auto updates enabled), you can run the following command:</p> <pre><code>sudo podman auto-update\n</code></pre>"},{"location":"examples/tutorials/basic-installation/","title":"Basic Installation","text":""},{"location":"examples/tutorials/basic-installation/#requirements","title":"Requirements","text":"<ol> <li>You need to have a host that you can manage</li> <li>You need to have a domain name or a public IP address</li> <li>You need a supported architecture (x86_64, arm64, armv7)</li> <li>You need curl installed on your host</li> </ol>"},{"location":"examples/tutorials/basic-installation/#install-docker","title":"Install Docker","text":"<p>Follow the Docs here: https://docs.docker.com/engine/install/ and install Docker on your host.</p>"},{"location":"examples/tutorials/basic-installation/#install-wg-easy","title":"Install <code>wg-easy</code>","text":"<ol> <li> <p>Create a directory for the configuration files (you can choose any directory you like):</p> <pre><code>sudo mkdir -p /etc/docker/containers/wg-easy\n</code></pre> </li> <li> <p>Download docker compose file</p> <pre><code>sudo curl -o /etc/docker/containers/wg-easy/docker-compose.yml https://raw.githubusercontent.com/wg-easy/wg-easy/master/docker-compose.yml\n</code></pre> </li> <li> <p>Start <code>wg-easy</code></p> <pre><code> cd /etc/docker/containers/wg-easy\n sudo docker compose up -d\n</code></pre> </li> </ol>"},{"location":"examples/tutorials/basic-installation/#setup-firewall","title":"Setup Firewall","text":"<p>If you are using a firewall, you need to open the following ports:</p> <ul> <li>UDP 51820 (WireGuard)</li> </ul> <p>These ports can be changed, so if you change them you have to update your firewall rules accordingly.</p>"},{"location":"examples/tutorials/basic-installation/#setup-reverse-proxy","title":"Setup Reverse Proxy","text":"<ul> <li>To setup traefik follow the instructions here: Traefik</li> <li>To setup caddy follow the instructions here: Caddy</li> <li>If you do not want to use a reverse proxy follow the instructions here: No Reverse Proxy</li> </ul>"},{"location":"examples/tutorials/basic-installation/#update-wg-easy","title":"Update <code>wg-easy</code>","text":"<p>To update <code>wg-easy</code> to the latest version, run:</p> <pre><code>cd /etc/docker/containers/wg-easy\nsudo docker compose pull\nsudo docker compose up -d\n</code></pre>"},{"location":"examples/tutorials/basic-installation/#auto-update","title":"Auto Update","text":"<p>If you want to enable auto-updates, follow the instructions here: Auto Updates</p>"},{"location":"examples/tutorials/caddy/","title":"Caddy","text":"<p>Opinionated</p> <p>This guide is opinionated. If you use other conventions or folder layouts, feel free to change the commands and paths.</p> <p>We're using Caddy here as reserve proxy to serve <code>wg-easy</code> on https://wg-easy.example.com via TLS.</p>"},{"location":"examples/tutorials/caddy/#create-a-docker-composition-for-caddy","title":"Create a docker composition for <code>caddy</code>","text":"<pre><code>.\n\u251c\u2500\u2500 compose.yml\n\u2514\u2500\u2500 Caddyfile\n\n1 directory, 2 files\n</code></pre> <pre><code># compose.yml\n\nservices:\n caddy:\n container_name: caddy\n image: caddy:2.10.0-alpine\n # publish everything you deem necessary\n ports:\n - '80:80/tcp'\n - '443:443/tcp'\n - '443:443/udp'\n networks:\n - caddy\n restart: unless-stopped\n volumes:\n - './Caddyfile:/etc/caddy/Caddyfile:ro'\n - config:/config\n - data:/data\n\nnetworks:\n caddy:\n name: caddy\n\nvolumes:\n config:\n data:\n</code></pre> <pre><code># Caddyfile\n\n{\n # setup your email address\n email mail@example.com\n}\n\nwg-easy.example.com {\n # since the container will share the network with wg-easy\n # we can use the proper container name\n reverse_proxy wg-easy:80\n tls internal\n}\n</code></pre> <p>...and start it with:</p> <pre><code>sudo docker compose up -d\n</code></pre>"},{"location":"examples/tutorials/caddy/#adapt-the-docker-composition-of-wg-easy","title":"Adapt the docker composition of <code>wg-easy</code>","text":"<pre><code>services:\n wg-easy:\n # sync container name and port according to Caddyfile\n container_name: wg-easy\n environment:\n - PORT=80\n # no need to publish the HTTP server anymore\n ports:\n - \"51820:51820/udp\"\n # add to caddy network\n networks:\n caddy:\n ...\n\nnetworks:\n caddy:\n external: true\n ...\n</code></pre> <p>...and restart it with:</p> <pre><code>sudo docker compose up -d\n</code></pre> <p>You can now access <code>wg-easy</code> at https://wg-easy.example.com and start the setup.</p>"},{"location":"examples/tutorials/docker-run/","title":"Docker Run","text":"<p>To setup the IPv6 Network, simply run once:</p> <pre><code>docker network create \\\n -d bridge --ipv6 \\\n -d default \\\n --subnet 10.42.42.0/24 \\\n --subnet fdcc:ad94:bacf:61a3::/64 wg \\\n</code></pre> <p>To automatically install & run <code>wg-easy</code>, simply run:</p> <pre><code>docker run -d \\\n --net wg \\\n -e INSECURE=true \\\n --name wg-easy \\\n --ip6 fdcc:ad94:bacf:61a3::2a \\\n --ip 10.42.42.42 \\\n -v ~/.wg-easy:/etc/wireguard \\\n -v /lib/modules:/lib/modules:ro \\\n -p 51820:51820/udp \\\n -p 51821:51821/tcp \\\n --cap-add NET_ADMIN \\\n --cap-add SYS_MODULE \\\n --sysctl net.ipv4.ip_forward=1 \\\n --sysctl net.ipv4.conf.all.src_valid_mark=1 \\\n --sysctl net.ipv6.conf.all.disable_ipv6=0 \\\n --sysctl net.ipv6.conf.all.forwarding=1 \\\n --sysctl net.ipv6.conf.default.forwarding=1 \\\n --restart unless-stopped \\\n ghcr.io/wg-easy/wg-easy:15\n</code></pre> <p>The Web UI will now be available at http://0.0.0.0:51821.</p>"},{"location":"examples/tutorials/dockerless/","title":"Without Docker","text":"<p>This is currently not yet supported.</p>"},{"location":"examples/tutorials/podman-nft/","title":"Podman + nftables","text":"<p>This guide will show you how to run <code>wg-easy</code> with rootful Podman and nftables.</p>"},{"location":"examples/tutorials/podman-nft/#requirements","title":"Requirements","text":"<ol> <li>Podman installed with version 4.4 or higher</li> </ol>"},{"location":"examples/tutorials/podman-nft/#configuration","title":"Configuration","text":"<p>Create a Folder for the configuration files:</p> <pre><code>sudo mkdir -p /etc/containers/systemd/wg-easy\nsudo mkdir -p /etc/containers/volumes/wg-easy\n</code></pre> <p>Create a file <code>/etc/containers/systemd/wg-easy/wg-easy.container</code> with the following content:</p> <pre><code>[Container]\nContainerName=wg-easy\nImage=ghcr.io/wg-easy/wg-easy:15\nAutoUpdate=registry\n\nVolume=/etc/containers/volumes/wg-easy:/etc/wireguard:Z\nNetwork=wg-easy.network\nPublishPort=51820:51820/udp\nPublishPort=51821:51821/tcp\n\n# this is used to allow access over HTTP\n# remove this when using a reverse proxy\nEnvironment=INSECURE=true\n\nAddCapability=NET_ADMIN\nAddCapability=SYS_MODULE\nAddCapability=NET_RAW\nSysctl=net.ipv4.ip_forward=1\nSysctl=net.ipv4.conf.all.src_valid_mark=1\nSysctl=net.ipv6.conf.all.disable_ipv6=0\nSysctl=net.ipv6.conf.all.forwarding=1\nSysctl=net.ipv6.conf.default.forwarding=1\n\n[Install]\n# this is used to start the container on boot\nWantedBy=default.target\n</code></pre> <p>Create a file <code>/etc/containers/systemd/wg-easy/wg-easy.network</code> with the following content:</p> <pre><code>[Network]\nNetworkName=wg-easy\nIPv6=true\n</code></pre>"},{"location":"examples/tutorials/podman-nft/#load-kernel-modules","title":"Load Kernel Modules","text":"<p>You will need to load the following kernel modules</p> <pre><code>wireguard\nnft_masq\n</code></pre> <p>Create a file <code>/etc/modules-load.d/wg-easy.conf</code> with the following content:</p> <pre><code>wireguard\nnft_masq\n</code></pre>"},{"location":"examples/tutorials/podman-nft/#start-the-container","title":"Start the Container","text":"<pre><code>sudo systemctl daemon-reload\nsudo systemctl start wg-easy\n</code></pre>"},{"location":"examples/tutorials/podman-nft/#edit-hooks","title":"Edit Hooks","text":"<p>In the Admin Panel of your WireGuard server, go to the <code>Hooks</code> tab and add the following hook:</p> <ol> <li> <p>PostUp</p> <pre><code>nft add table inet wg_table; nft add chain inet wg_table prerouting { type nat hook prerouting priority 100 \\; }; nft add chain inet wg_table postrouting { type nat hook postrouting priority 100 \\; }; nft add rule inet wg_table postrouting ip saddr {{ipv4Cidr}} oifname {{device}} masquerade; nft add rule inet wg_table postrouting ip6 saddr {{ipv6Cidr}} oifname {{device}} masquerade; nft add chain inet wg_table input { type filter hook input priority 0 \\; policy accept \\; }; nft add rule inet wg_table input udp dport {{port}} accept; nft add rule inet wg_table input tcp dport {{uiPort}} accept; nft add chain inet wg_table forward { type filter hook forward priority 0 \\; policy accept \\; }; nft add rule inet wg_table forward iifname \"wg0\" accept; nft add rule inet wg_table forward oifname \"wg0\" accept;\n</code></pre> </li> <li> <p>PostDown</p> <pre><code>nft delete table inet wg_table\n</code></pre> </li> </ol> <p>If you don't have iptables loaded on your server, you could see many errors in the logs or in the UI. You can ignore them.</p>"},{"location":"examples/tutorials/podman-nft/#restart-the-container","title":"Restart the Container","text":"<p>Restart the container to apply the new hooks:</p> <pre><code>sudo systemctl restart wg-easy\n</code></pre>"},{"location":"examples/tutorials/reverse-proxyless/","title":"No Reverse Proxy","text":"<p>Insecure</p> <p>This is insecure. You should use a reverse proxy to secure the connection.</p> <p>Only use this method if you know what you are doing.</p> <p>If you only allow access to the web UI from your local network, you can skip the reverse proxy setup. This is not recommended, but it is possible.</p>"},{"location":"examples/tutorials/reverse-proxyless/#setup","title":"Setup","text":"<ul> <li> <p>Edit the <code>docker-compose.yml</code> file and uncomment <code>environment</code> and <code>INSECURE</code></p> </li> <li> <p>Set <code>INSECURE</code> to <code>true</code> to allow access to the web UI over a non-secure connection.</p> </li> <li> <p>The <code>docker-compose.yml</code> file should look something like this:</p> <pre><code>environment:\n - INSECURE=true\n</code></pre> </li> <li> <p>Save the file and restart <code>wg-easy</code>.</p> </li> <li> <p>Make sure that the Web UI is not accessible from outside your local network.</p> </li> </ul>"},{"location":"examples/tutorials/traefik/","title":"Traefik","text":"<p>Opinionated</p> <p>This guide is opinionated. If you use other conventions or folder layouts, feel free to change the commands and paths.</p>"},{"location":"examples/tutorials/traefik/#create-docker-compose-project","title":"Create docker compose project","text":"<pre><code>sudo mkdir -p /etc/docker/containers/traefik\ncd /etc/docker/containers/traefik\n</code></pre>"},{"location":"examples/tutorials/traefik/#create-docker-compose-file","title":"Create docker compose file","text":"<p>File: <code>/etc/docker/containers/traefik/docker-compose.yml</code></p> <pre><code>services:\n traefik:\n image: traefik:3.3\n container_name: traefik\n restart: unless-stopped\n ports:\n - '80:80'\n - '443:443/tcp'\n - '443:443/udp'\n volumes:\n - /var/run/docker.sock:/var/run/docker.sock\n - /etc/docker/volumes/traefik/traefik.yml:/traefik.yml:ro\n - /etc/docker/volumes/traefik/traefik_dynamic.yml:/traefik_dynamic.yml:ro\n - /etc/docker/volumes/traefik/acme.json:/acme.json\n networks:\n - traefik\n\nnetworks:\n traefik:\n external: true\n</code></pre>"},{"location":"examples/tutorials/traefik/#create-traefikyml","title":"Create traefik.yml","text":"<p>File: <code>/etc/docker/volumes/traefik/traefik.yml</code></p> <pre><code>log:\n level: INFO\n\nentryPoints:\n web:\n address: ':80/tcp'\n http:\n redirections:\n entryPoint:\n to: websecure\n scheme: https\n websecure:\n address: ':443/tcp'\n http:\n middlewares:\n - compress@file\n - hsts@file\n tls:\n certResolver: letsencrypt\n http3: {}\n\napi:\n dashboard: true\n\ncertificatesResolvers:\n letsencrypt:\n acme:\n email: $mail@example.com$\n storage: acme.json\n httpChallenge:\n entryPoint: web\n\nproviders:\n docker:\n watch: true\n network: traefik\n exposedByDefault: false\n file:\n filename: traefik_dynamic.yml\n\nserversTransport:\n insecureSkipVerify: true\n</code></pre>"},{"location":"examples/tutorials/traefik/#create-traefik_dynamicyml","title":"Create traefik_dynamic.yml","text":"<p>File: <code>/etc/docker/volumes/traefik/traefik_dynamic.yml</code></p> <pre><code>http:\n middlewares:\n services:\n basicAuth:\n users:\n - '$username$:$password$'\n compress:\n compress: {}\n hsts:\n headers:\n stsSeconds: 2592000\n routers:\n api:\n rule: Host(`traefik.$example.com$`)\n entrypoints:\n - websecure\n middlewares:\n - services\n service: api@internal\n\ntls:\n options:\n default:\n cipherSuites:\n - TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256\n - TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384\n - TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256\n sniStrict: true\n</code></pre>"},{"location":"examples/tutorials/traefik/#create-acmejson","title":"Create acme.json","text":"<pre><code>sudo touch /etc/docker/volumes/traefik/acme.json\nsudo chmod 600 /etc/docker/volumes/traefik/acme.json\n</code></pre>"},{"location":"examples/tutorials/traefik/#create-network","title":"Create network","text":"<pre><code>sudo docker network create traefik\n</code></pre>"},{"location":"examples/tutorials/traefik/#start-traefik","title":"Start traefik","text":"<pre><code>sudo docker compose up -d\n</code></pre> <p>You can no access the Traefik dashboard at <code>https://traefik.$example.com$</code> with the credentials you set in <code>traefik_dynamic.yml</code>.</p>"},{"location":"examples/tutorials/traefik/#add-labels-to-wg-easy","title":"Add Labels to <code>wg-easy</code>","text":"<p>To add labels to your <code>wg-easy</code> service, you can add the following to your <code>docker-compose.yml</code> file:</p> <p>File: <code>/etc/docker/containers/wg-easy/docker-compose.yml</code></p> <pre><code>services:\n wg-easy:\n ...\n container_name: wg-easy\n networks:\n ...\n traefik: {}\n labels:\n - \"traefik.enable=true\"\n - \"traefik.http.routers.wg-easy.rule=Host(`wg-easy.$example.com$`)\"\n - \"traefik.http.routers.wg-easy.entrypoints=websecure\"\n - \"traefik.http.routers.wg-easy.service=wg-easy\"\n - \"traefik.http.services.wg-easy.loadbalancer.server.port=51821\"\n ...\n\nnetworks:\n ...\n traefik:\n external: true\n</code></pre>"},{"location":"examples/tutorials/traefik/#restart-wg-easy","title":"Restart <code>wg-easy</code>","text":"<pre><code>cd /etc/docker/containers/wg-easy\nsudo docker compose up -d\n</code></pre> <p>You can now access <code>wg-easy</code> at <code>https://wg-easy.$example.com$</code> and start the setup.</p>"},{"location":"guides/2fa/","title":"2FA","text":"<p>The user can enable 2FA from the Account page. The Account page is accessible from the dropdown menu in the top right corner of the application.</p>"},{"location":"guides/2fa/#enable-totp","title":"Enable TOTP","text":"<ul> <li>Enable Two Factor Authentication: Enable TOTP for the user.</li> </ul>"},{"location":"guides/2fa/#configure-totp","title":"Configure TOTP","text":"<p>A QR code will be displayed. Scan the QR code with your TOTP application (e.g., Google Authenticator, Authy, etc.) to add the account.</p> <p>To verify that the TOTP key is working, the user must enter the TOTP code generated by the TOTP application.</p> <ul> <li>TOTP Key: The TOTP key for the user. This key is used to generate the TOTP code.</li> <li>TOTP Code: The current TOTP code for the user. This code is used to verify the TOTP key.</li> <li>Enable Two Factor Authentication: Enable TOTP for the user.</li> </ul>"},{"location":"guides/2fa/#disable-totp","title":"Disable TOTP","text":"<p>To disable TOTP, the user must enter the current password.</p> <ul> <li>Current Password: The current password of the user.</li> <li>Disable Two Factor Authentication: Disable TOTP for the user.</li> </ul>"},{"location":"guides/admin/","title":"Admin Panel","text":"<p>TODO</p>"},{"location":"guides/cli/","title":"CLI","text":"<p>If you want to use the CLI, you can run it with</p>"},{"location":"guides/cli/#docker-compose","title":"Docker Compose","text":"<pre><code>cd /etc/docker/containers/wg-easy\ndocker compose exec -it wg-easy cli\n</code></pre>"},{"location":"guides/cli/#docker-run","title":"Docker Run","text":"<pre><code>docker run --rm -it \\\n -v ~/.wg-easy:/etc/wireguard \\\n ghcr.io/wg-easy/wg-easy:15 \\\n cli\n</code></pre>"},{"location":"guides/cli/#reset-password","title":"Reset Password","text":"<p>If you want to reset the password for the admin user, you can run the following command:</p>"},{"location":"guides/cli/#by-prompt","title":"By Prompt","text":"<pre><code>cd /etc/docker/containers/wg-easy\ndocker compose exec -it wg-easy cli db:admin:reset\n</code></pre> <p>You are asked to provide the new password</p>"},{"location":"guides/cli/#by-argument","title":"By Argument","text":"<pre><code>cd /etc/docker/containers/wg-easy\ndocker compose exec -it wg-easy cli db:admin:reset --password <new_password>\n</code></pre> <p>This will reset the password for the admin user to the new password you provided. If you include special characters in the password, make sure to escape them properly.</p>"},{"location":"guides/clients/","title":"Edit Client","text":""},{"location":"guides/clients/#general","title":"General","text":"<ul> <li>Name: The name of the client.</li> <li>Enabled: Whether the client can connect to the VPN.</li> <li>Expire Date: The date the client will be disabled.</li> </ul>"},{"location":"guides/clients/#address","title":"Address","text":"<ul> <li>IPv4: The IPv4 address of the client.</li> <li>IPv6: The IPv6 address of the client.</li> </ul>"},{"location":"guides/clients/#allowed-ips","title":"Allowed IPs","text":"<p>Which IPs will be routed through the VPN.</p> <p>This will not prevent the user from modifying it locally and accessing IP ranges that they should not be able to access.</p> <p>Use firewall rules to prevent access to IP ranges that the user should not be able to access.</p>"},{"location":"guides/clients/#server-allowed-ips","title":"Server Allowed IPs","text":"<p>Which IPs will be routed to the client.</p>"},{"location":"guides/clients/#dns","title":"DNS","text":"<p>The DNS server that the client will use.</p>"},{"location":"guides/clients/#advanced","title":"Advanced","text":"<ul> <li>MTU: The maximum transmission unit for the client.</li> <li>Persistent Keepalive: The interval for sending keepalive packets to the server.</li> </ul>"},{"location":"guides/clients/#hooks","title":"Hooks","text":"<p>This can only be used for clients that use <code>wg-quick</code>. Setting this will throw a error when importing the config on other clients.</p> <ul> <li>PreUp: Commands to run before the interface is brought up.</li> <li>PostUp: Commands to run after the interface is brought up.</li> <li>PreDown: Commands to run before the interface is brought down.</li> <li>PostDown: Commands to run after the interface is brought down.</li> </ul>"},{"location":"guides/clients/#actions","title":"Actions","text":"<ul> <li>Save: Save the changes made in the form.</li> <li>Revert: Revert the changes made in the form.</li> <li>Delete: Delete the client.</li> </ul>"},{"location":"guides/setup/","title":"Setup","text":""},{"location":"guides/setup/#user-setup","title":"User Setup","text":"<ul> <li>Username: The username of the user.</li> <li>Password: The password of the user.</li> <li>Confirm Password: The password of the user.</li> </ul>"},{"location":"guides/setup/#existing-setup","title":"Existing Setup","text":"<p>If you have the config from the previous version, you can import it by clicking \"Yes\". This currently expects a config from v14.</p> <p>If this is the first time you are using this, you can click \"No\" to create a new config.</p>"},{"location":"guides/setup/#no-host-setup","title":"No - Host Setup","text":"<ul> <li>Host: The host of the server. The clients will connect to this address. This can be a domain name or an IP address. Make sure to wrap it in brackets if it is an IPv6 address. For example: <code>[::1]</code> or <code>[2001:db8::1]</code>.</li> <li>Port: The port of the server. The clients will connect to this port. The server will listen on this port.</li> </ul>"},{"location":"guides/setup/#yes-migration","title":"Yes - Migration","text":"<p>Select the <code>wg0.json</code> file from the previous version. Read Migrate from v14 to v15 for more information.</p>"}]}
|