WireGuard VPN Server on a VPS: Setup, Users and Connections
Run your own WireGuard VPN with a web panel: add users, connect from Windows, macOS, iPhone, Android and Linux, use the server as an HTTP proxy and manage the panel password.
WireGuard is a fast, modern VPN protocol with strong encryption and official apps for Windows, macOS, Linux, Android and iOS.
When you order a WireGuard VPS, WireGuard and the WireGuard UI web panel are installed for you, so you can add users and hand out connection files from your browser. Setup takes 15–20 minutes, including the operating system.
- Operating system: Ubuntu 22.04
- Minimum server: 1 vCPU and 1 GB RAM
- Panel login: root, with your server’s root password
Open the WireGuard UI panel
When your server is ready, we email you its IP address, the root password and the link to your WireGuard UI panel. The same details are in your client area, under the server’s information.
- Open the panel link from the email.
- Log in with the username root.
- Enter the root password from the same email.
The panel keeps the password set during installation, so changing the root password in the operating system does not change it (see step 8). If the panel says the login worked but nothing happens, connect to the server over SSH as root and restart the panel:
docker restart wireguard-uiCreate a VPN user
Give each person or device its own client in the panel.
- In the left menu, open WireGuard Clients.
- Click New Client in the top-right corner.
- Enter a Name. Leave IP Allocation and Allowed IPs as they are: 0.0.0.0/0 sends all of the device’s traffic through the VPN.
- Keep the generated Preshared Key. It adds a second layer of encryption without slowing the connection.
- Click Submit.
- Click Apply Config in the top-right corner.
Changes take effect only after you click Apply Config. Until then, the new client cannot connect.
Connect from Windows or macOS
Use the official WireGuard app with the client’s configuration file.
- Install the WireGuard app from wireguard.com or the Mac App Store.
- In the panel, open WireGuard Clients, find the client and click Download.
- In the app, click Import tunnel(s) from file and choose the downloaded file. The tunnel appears with the client’s name, marked Inactive.
- Click Activate. The status changes to Active.
If the connection does not work straight away, restart your computer once.
Connect from iPhone or Android
Phones and tablets can add the tunnel by scanning a QR code.
- Install WireGuard from the App Store or Google Play.
- In the panel, open WireGuard Clients, find the client and click QR code.
- In the app, tap Add tunnel (+) and choose Create from QR code.
- Scan the code and give the tunnel a name.
- Allow the app to add VPN configurations when your phone asks.
- Turn the tunnel on.
Connect from Linux
Download the client’s configuration file from the panel, then import it with NetworkManager:
Replace client.conf with your file’s name. The connection takes the file’s name, so use the same name in the second command.
sudo nmcli connection import type wireguard file "client.conf"
nmcli connection up clientUse the server as an HTTP proxy
The server also runs an HTTP proxy that is reachable only through the VPN, at 10.252.1.1 on port 3128. Set it in your browser’s proxy settings or with an extension such as SwitchyOmega.
- Connect to the VPN first.
- Install SwitchyOmega for Chrome or Firefox and open its options.
- Click New profile, give it a name and choose Proxy Profile.
- Set Protocol to HTTP, Server to 10.252.1.1 and Port to 3128.
- Click Apply changes.
- Click the SwitchyOmega icon and choose your new profile.
The proxy works only while the VPN is connected.
Check that the VPN works
With the VPN on, search for “what is my IP” or open any IP lookup site. It should show your server’s IP address and location instead of your own.
Change the panel password
Use this to set a new panel password or to reset a forgotten one. Connect to the server over SSH as root, edit the panel’s user file and restart the panel:
Keep the username line as it is. The new password works as soon as the panel restarts.
nano /data/wgui/users/root.json
# set a new password and clear the hash:
# "password": "your-new-password",
# "password_hash": "",
docker restart wireguard-uiWhat’s installed, and how to customise it
The panel runs in Docker containers that you can change if you need to.
- Docker CE and Docker Compose.
- WireGuard UI (ngoduykhanh/wireguard-ui), the web panel.
- Nginx with Certbot (jonasal/nginx-certbot), which serves the panel over HTTPS.
- Compose file: /root/wgui/compose.yml. Data: /data.
To customise the setup, edit /root/wgui/compose.yml and restart the containers:
nano /root/wgui/compose.yml
cd /root/wgui && docker compose down && docker compose up -dGet a server for this guide
WireGuard VPS comes ready with everything in this guide, from $7.50/mo billed yearly.
See WireGuard VPS plansTable of Contents
- 1.1. Open the WireGuard UI panel
- 2.2. Create a VPN user
- 3.3. Connect from Windows or macOS
- 4.4. Connect from iPhone or Android
- 5.5. Connect from Linux
- 6.6. Use the server as an HTTP proxy
- 7.7. Check that the VPN works
- 8.8. Change the panel password
- 9.9. What’s installed, and how to customise it
Explore More VPS Hosting Options
Find the right server for your project.
Start Your NodexVPS Today
Save 50% with yearly billing. No contract, cancel any time.