Back to all templates
WireGuard logo

WireGuard

Development64MB+ RAM

Fast, modern VPN with simple configuration

vpnsecuritynetwork

Deploy WireGuard in 3 Steps

1

Connect Your VPS

Add your server credentials to Server Compass

2

Select WireGuard

Choose from our template library

3

Deploy & Configure

Fill in settings and click Deploy

No Docker knowledge required
Step-by-step deployment guide

Deploy WireGuard on a VPS with Server Compass

Use the WireGuard template in Server Compass to deploy a self-hosted VPN server on your VPS, then verify the UDP service and generated peer configs.

About 10 minutesBrowser verified
1
Step 1

Open the server Apps tab

Select the tutorial-vps VPS, open the Apps tab, and start a new app deployment. Keep sensitive server details hidden before capturing or sharing screenshots.

Server Compass Apps tab before creating a WireGuard app
2
Step 2

Choose an app template

Click New App and choose the template deployment path so Server Compass can load the built-in catalog.

Choosing to deploy an app from a Server Compass template
3
Step 3

Search for WireGuard

Use the template picker search to find WireGuard in the Server Compass template catalog.

Searching for WireGuard in the Server Compass template picker
4
Step 4

Select the WireGuard template

Choose the WireGuard template. Server Compass fills the WireGuard service, UDP port, peer count, and persistent configuration volume.

WireGuard template selected in Server Compass
5
Step 5

Review the WireGuard settings

Confirm the app name and compose service. In this run, the app was named wireguard-demo and used UDP host port 51820.

Reviewing WireGuard project settings and compose services
6
Step 6

Deploy WireGuard

Review the generated compose settings, fill the server URL and peer count if needed, confirm the WireGuard UDP port is available, and click Deploy.

Reviewing WireGuard environment variables and port before deployment
7
Step 7

Watch the deployment progress

Keep the deployment modal open while Server Compass uploads the compose file, pulls the WireGuard image, starts the container, and verifies the stack.

Server Compass deploying the WireGuard template on the VPS
8
Step 8

Confirm WireGuard is running

After deployment finishes, return to the Apps tab and confirm the WireGuard app is marked Running.

WireGuard template running in the Server Compass Apps tab
9
Step 9

Verify the WireGuard service

Open the app details or service view and confirm the WireGuard service is running. The final verification also checks the UDP port and confirms peer config files were generated without exposing private keys.

WireGuard service running with UDP port and generated peer configs

After WireGuard Opens

  • Download each peer config from the generated config volume and distribute it through a secure channel.
  • Keep peer private keys and QR codes out of screenshots, logs, tickets, and public documentation.
  • Open only the required WireGuard UDP port in the firewall and restrict administrative SSH access separately.
  • Back up the WireGuard config volume before relying on it for production VPN access.
  • Rotate peer configs immediately if a device or config file is lost.

Verified Result

The WireGuard container was running on the VPS, Docker published the expected UDP port, and peer config files existed in the config volume.

WireGuard deployment questions

What does the WireGuard template deploy?

It deploys the linuxserver.io WireGuard container with a persistent config volume, generated peer configs, and an exposed UDP endpoint.

Which port did the tutorial use?

The tutorial used UDP host port 51820, mapped to WireGuard container port 51820/udp.

Why does this guide verify services instead of a web UI?

WireGuard is not a browser application. It is considered ready when the container is running, the UDP port is published, and peer config files are generated.

Should this become a blog post?

No. The deployment guide should live on the WireGuard template detail page and be linked from the reusable template deployment docs page.

Manual Deployment Guide

Manual WireGuard Setup

For terminal enthusiasts: deploy WireGuard manually with these simple steps.

1

SSH into Your Server

Launch your preferred terminal and connect to your VPS using SSH.

terminal
# Log into your server
ssh root@<your-server-ip>

# If using key-based auth
ssh -i ~/.ssh/my-key root@<your-server-ip>

First time? Docker not installed? Run: curl -fsSL https://get.docker.com | sh

2

Create Working Directory

Prepare a directory for your application files and configuration.

terminal
# Create and navigate to project directory
mkdir -p ~/apps/wireguard
cd ~/apps/wireguard
3

Configure Your Containers

Create the Docker Compose configuration file with these contents:

docker-compose.yml
services:
  wireguard:
    image: linuxserver/wireguard:latest
    cap_add:
      - NET_ADMIN
      - SYS_MODULE
    ports:
      - "51820:51820/udp"
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=UTC
      - SERVERURL=<your-server-url>
      - SERVERPORT=51820
      - PEERS=3
      - PEERDNS=auto
    volumes:
      - wireguard_config:/config
      - /lib/modules:/lib/modules:ro
    sysctls:
      - net.ipv4.conf.all.src_valid_mark=1
    restart: unless-stopped

volumes:
  wireguard_config:
Environment Configuration
PORTUDP port(default: 51820)
SERVER_URLServer URL
PEERSNumber of peers(default: 3)
4

Deploy with Docker Compose

Launch the application stack using Docker Compose.

terminal
# Deploy the application
docker compose up -d

# Check container health
docker compose ps

# Monitor logs
docker compose logs -f --tail=100
5

Open Required Ports

Enable external access by opening the necessary port.

terminal
# Allow the application port through firewall
sudo ufw allow 51820/tcp
sudo ufw reload

# Access your app at:
# http://your-server-ip:51820
Skip the Terminal

There's an easier way. Meet Server Compass.

Deploy WireGuard without touching the command line. Server Compass gives you a clean UI for one-click deployments.

  • Intuitive dashboard
  • Deploy in 3 minutes
  • Free SSL included
  • Blue-green deploys
  • Real-time logs
  • Version history
Download Server Compass$29 one-time • Lifetime license

After Deployment

After deploying WireGuard with Server Compass, complete these steps to finish setup

1

Get peer configs from container

2

Distribute to clients

3

Test VPN connection

Need help? Check out our documentation for detailed guides.

WireGuard FAQ

Common questions about self-hosting WireGuard

How do I deploy WireGuard with Server Compass?

Simply download Server Compass, connect to your VPS, and select WireGuard from the templates list. Fill in the required configuration and click Deploy. The entire process takes under 3 minutes.

What are the system requirements for WireGuard?

WireGuard requires a minimum of 64MB RAM. We recommend a VPS with at least 1024MB RAM for optimal performance. Any modern Linux server with Docker support will work.

Can I migrate my existing WireGuard data?

Yes! Server Compass provides volume mapping that allows you to import existing data. You can also use standard WireGuard backup and restore procedures.

How do I update WireGuard to the latest version?

Server Compass makes updates easy. Simply click the Update button in your deployment dashboard, and the latest WireGuard image will be pulled and deployed with zero downtime.

Is WireGuard free to self-host?

WireGuard is open-source software. You only pay for your VPS hosting (typically $5-20/month) and optionally Server Compass ($29 one-time). No subscription fees or per-seat pricing.

Ready to Self-Host WireGuard?

Download Server Compass and deploy WireGuard to your VPS in under 3 minutes. No Docker expertise required.

Download Server Compass