</code></pre></div><p>By default, the webserver is listening on port <strong>8888</strong>.</p><p>Volumes for <code>/app/data</code> and <code>/app/config</code> should be used ensure data persistence across container restarts.</p><h2id=image-versioning>Image Versioning</h2><p>All images are hosted on Docker Hub at <ahref=https://hub.docker.com/r/wgportal/wg-portal>https://hub.docker.com/r/wgportal/wg-portal</a>. There are three types of tags in the repository:</p><h4id=semantic-versioned-tags>Semantic versioned tags</h4><p>For example, <code>1.0.19</code>.</p><p>These are official releases of WireGuard Portal. They correspond to the GitHub tags that we make, and you can see the release notes for them here: <ahref=https://github.com/h44z/wg-portal/releases>https://github.com/h44z/wg-portal/releases</a>.</p><p>Once these tags show up in this repository, they will never change.</p><p>For production deployments of WireGuard Portal, we strongly recommend using one of these tags, e.g. <strong>wgportal/wg-portal:1.0.19</strong>, instead of the latest or canary tags.</p><p>If you only want to stay at the same major or major+minor version, use either <code>v[MAJOR]</code> or <code>[MAJOR].[MINOR]</code> tags. For example <code>v1</code> or <code>1.0</code>.</p><p>Version <strong>1</strong> is currently <strong>stable</strong>, version <strong>2</strong> is in <strong>development</strong>.</p><h4id=latest>latest</h4><p>This is the most recent build to master! It changes a lot and is very unstable.</p><p>We recommend that you don't use it except for development purposes.</p><h4id=branch-tags>Branch tags</h4><p>For each commit in the master and the stable branch, a corresponding Docker image is build. These images use the <code>master</code> or <code>stable</code> tags.</p><h2id=configuration>Configuration</h2><p>You can configure WireGuard Portal using a yaml configuration file. The filepath of the yaml configuration file defaults to <code>/app/config/config.yml</code>. It is possible to override the configuration filepath using the environment variable <strong>WG_PORTAL_CONFIG</strong>.</p><p>By default, WireGuard Portal uses a SQLite database. The database is stored in <code>/app/data/sqlite.db</code>.</p><p>You should mount those directories as a volume:</p><ul><li>/app/data</li><li>/app/config</li></ul><p>A detailed description of the configuration options can be found <ahref=../../configuration/overview/>here</a>.</p><h2id=running-wireguard-inside-docker>Running WireGuard inside Docker</h2><p>Modern Linux distributions ship with a kernel that supports WireGuard out of the box. This means that you can run WireGuard directly on the host system without the need for a Docker container. WireGuard Portal can then manage the WireGuard interfaces directly on the host.</p><p>If you still want to run WireGuard inside a Docker container, you can use the following example docker-compose.yml:</p><divclass=highlight><pre><span></span><code><spanclass=nt>services</span><spanclass=p>:</span>
<spanclass=w></span><spanclass=nt>network_mode</span><spanclass=p>:</span><spanclass=w></span><spanclass=s>"service:wireguard"</span><spanclass=w></span><spanclass=c1># So we ensure to stay on the same network as the wireguard container.</span>
<spanclass=w></span><spanclass="p p-Indicator">-</span><spanclass=w></span><spanclass=s>"51820:51820/udp"</span><spanclass=w></span><spanclass=c1># WireGuard port, needs to match the port in wg-portal interface config</span>
<spanclass=w></span><spanclass="p p-Indicator">-</span><spanclass=w></span><spanclass=s>"127.0.0.1:8888:8888"</span><spanclass=w></span><spanclass=c1># Noticed that the port of the web UI is exposed in the wireguard container.</span>
<spanclass=w></span><spanclass="p p-Indicator">-</span><spanclass=w></span><spanclass="l l-Scalar l-Scalar-Plain">./wg/etc:/config/wg_confs</span><spanclass=w></span><spanclass=c1># We share the configuration (wgx.conf) between wg-portal and wireguard</span>
</code></pre></div><p>For this to work, you need to have at least the following configuration set in your WireGuard Portal config:</p><divclass=highlight><pre><span></span><code><spanclass=nt>core</span><spanclass=p>:</span>
<spanclass=w></span><spanclass=c1># The WireGuard container uses wg-quick to manage the WireGuard interfaces - this conflicts with WireGuard Portal during startup.</span>
<spanclass=w></span><spanclass=c1># To avoid this, we need to set the restore_state option to false so that wg-quick can create the interfaces.</span>
<spanclass=w></span><spanclass=c1># WireGuard Portal needs to export the WireGuard configuration as wg-quick config files so that the WireGuard container can use them.</span>