Install VpnHood! SERVER on Linux
Run your own VPN server on any Linux machine with a public IP address. VpnHood! MANAGER can install it for you as a managed server, or one command installs it as a standalone server.
-
Your server
VpnHood! SERVER runs on a machine you control, such as a VPS.
-
An access key
MANAGER or the server creates it. Whoever has the key can connect.
-
Your devices
Add the key to VpnHood! CLIENT on a phone or a computer.
Before you start
- A machine with a public IP address, running Linux on x64 or arm64. System requirements lists the systems it runs on.
- Root access. The install commands run through sudo, so it has to be on the machine even if you sign in as root.
- TCP port
443open, both in the machine's firewall and in your hosting provider's. It is the port the server listens on.
Install a standalone server
Run this command. It detects whether the machine is x64 or arm64, and installs the server into /opt/VpnHoodServer.
sudo bash -c 'u=https://github.com/vpnhood/VpnHood.App.Server/releases/latest/download/VpnHoodServer-linux.sh; bash <(wget -qO- $u 2>/dev/null || curl -fsSL $u)'To install it in a script, without the installer's questions, see Installer options.
Create your first access key
A standalone server lets in only devices that hold an access key it made. Run this on the server to create one.
sudo /opt/VpnHoodServer/vhserver genThe key is printed under --- AccessKey --- and starts with vh:; copy the whole line. A few lines above it, HostEndPoints: should show your server's public IP address.
To limit a key, add any of these options to the command.
| Option | What it does |
|---|---|
-name Phone | A name, to tell your keys apart. |
-maxClient 5 | How many devices can use the key at the same time. Without it: 2. |
-maxTraffic 50000 | A traffic limit, in megabytes. Without it: none. |
-maxSpeed 20 | A speed limit for both upload and download, in megabits per second. Without it: none. |
-expire 2030/01/25 | The day the key stops working. Without it: never. |
For example, a key for one phone that stops working at the end of 2030
sudo /opt/VpnHoodServer/vhserver gen -name Phone -maxClient 1 -expire 2031/01/01Anyone who has the key can connect through your server. Share it the way you would share a password.
Connect
Install VpnHood! CLIENT on each device, add the key, and connect.
Start and stop the server
The server runs as the VpnHoodServer service, whether it is managed or standalone.
sudo systemctl status VpnHoodServersudo systemctl stop VpnHoodServersudo systemctl start VpnHoodServerIts log is in /opt/VpnHoodServer/storage/logs/server.log.
If you installed it without the service, start it yourself with sudo /opt/VpnHoodServer/vhserver. It runs until you stop it with sudo /opt/VpnHoodServer/vhserver stop from another terminal.
Updates
Unless you turned it off at install, the server updates itself to each new release: the VpnHoodServerUpdater service checks every 12 hours.
To turn this off, run the standalone install command again and answer n to Keep the server up to date by itself (Y/n)?. The installer keeps your answer and your settings, so the server stays on its version until you run the command yourself.
Keep updates on if you can. Some releases fix security issues. An updated app still connects to an older server, but gets no UDP from one before v9.0.859, and apps support servers older than VpnHood 9.1 only until April 2027.
Uninstall
To remove the server, run its uninstaller. It stops the server and removes its services and its files, but keeps its settings, access keys and certificates in /opt/VpnHoodServer/storage for a later install.
sudo /opt/VpnHoodServer/vhuninstallDelete its settings and keys too: devices that hold its keys can no longer connect, even to a new install
sudo /opt/VpnHoodServer/vhuninstall -purge