Skip to contentcloudvix
cloudvix

Don't want to trust a VPN provider? Run your own.

Your own WireGuard VPN on a Cloud Server

Your own VPN endpoint, with 1 TB of traffic included. From €0.0067 an hour.

Quartz · €0.0067 / hour · at most €4.49 / month per server · excl. VAT

Where your traffic goes

A WireGuard tunnel carries the traffic of your device to your server, and from there it goes to the internet. Example addresses from the steps below.

  1. Your devicePhone or laptop with the WireGuard app10.8.0.2
  2. Encrypted tunnelWireGuard between your device and the serverUDP 51820
  3. Your Cloud Server in FrankfurtPasses your traffic on to the internet10.8.0.1
  4. WebsitesSee the address of the server in Frankfurt, not yours
Traffic included per month
1 TB
Server location
Frankfurt

Which plan for WireGuard

A VPN needs little memory: Quartz (1 vCPU, 2 GB RAM) is enough to start. What counts is traffic: Quartz includes 1 TB a month. Plans with more vCPUs include more traffic.

The plan for this task

Quartz

  • 1 vCPU
  • 2 GB RAM
  • 20 GB NVMe
  • 1 TB traffic

Quartz · €0.0067 / hour · at most €4.49 / month per server

All plans and prices

Set up WireGuard in six steps

You need the server's IP address and the root login from your dashboard, and the WireGuard app on the device you want to connect. The commands follow the WireGuard documentation; check its pages if something has changed.

  1. Step 1: Log in over SSH

    Replace SERVER_IP with the address from your dashboard and log in as root with your SSH key or the root password.

    Step 1: Log in over SSH
    ssh root@SERVER_IP

  2. Step 2: Install WireGuard

    Installs WireGuard and iptables from the package sources of Ubuntu 24.04.

    Step 2: Install WireGuard
    apt-get update && apt-get install -y wireguard iptables

  3. Step 3: Create the server's keys

    Creates the server's key pair in /etc/wireguard, readable by root only, and turns on IP forwarding so the server can pass your traffic on.

    Step 3: Create the server's keys
    umask 077
    wg genkey | tee /etc/wireguard/server.key | wg pubkey > /etc/wireguard/server.pub
    echo 'net.ipv4.ip_forward=1' > /etc/sysctl.d/99-wireguard.conf && sysctl --system

  4. Step 4: Write the server's configuration

    The tunnel network is 10.8.0.0/24, WireGuard listens on UDP port 51820, and a NAT rule lets clients reach the internet. The name of the network interface is read from the server's default route.

    Step 4: Write the server's configuration
    cat > /etc/wireguard/wg0.conf <<EOF
    [Interface]
    Address = 10.8.0.1/24
    ListenPort = 51820
    PrivateKey = $(cat /etc/wireguard/server.key)
    PostUp = iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o $(ip -4 route show default | awk '{print $5}') -j MASQUERADE
    PostDown = iptables -t nat -D POSTROUTING -s 10.8.0.0/24 -o $(ip -4 route show default | awk '{print $5}') -j MASQUERADE
    EOF

  5. Step 5: Create the client's keys and configuration

    Run this on your own computer

    Create the client's keys, save the configuration below as wg0.conf and import it in the WireGuard app. The server's public key is in /etc/wireguard/server.pub; the endpoint is the server's address.

    Step 5: Create the client's keys and configuration
    # 1. create the client's keys (the second line is its public key)
    wg genkey | tee client.key | wg pubkey
    
    # 2. save this as wg0.conf and import it in the WireGuard app
    [Interface]
    PrivateKey = <content of client.key>
    Address = 10.8.0.2/32
    DNS = 1.1.1.1
    
    [Peer]
    PublicKey = <content of /etc/wireguard/server.pub>
    Endpoint = SERVER_IP:51820
    AllowedIPs = 0.0.0.0/0
    PersistentKeepalive = 25

  6. Step 6: Add the client and start the tunnel

    Adds the client's public key as a peer, starts the tunnel and shows its state. Once the client connects, wg show lists a recent handshake. The tunnel starts again after a reboot.

    Step 6: Add the client and start the tunnel
    cat >> /etc/wireguard/wg0.conf <<'EOF'
    
    [Peer]
    PublicKey = <public key of the client>
    AllowedIPs = 10.8.0.2/32
    EOF
    systemctl enable --now wg-quick@wg0
    wg show

WireGuard runs on your server and you look after it: installing, updating, backups and security of WireGuard are yours. Cloudvix provides the Cloud Server with root access, not a managed WireGuard service.

Create the server for WireGuard

Choose Quartz and Ubuntu 24.04 in the order form. A new server is usually ready in a few minutes.

Plan
Quartz · 1 vCPU · 2 GB RAM · 20 GB NVMe
System
Ubuntu 24.04
Location
Frankfurt
Price
Quartz · €0.0067 / hour · at most €4.49 / month per server
Create a server for WireGuard

The order form opens with the plan selected; pick the system from its list there. Prices exclude VAT.

Questions and answers

Does a VPN on my own server make me anonymous?

No. Websites see the address of your server in Frankfurt, and that address belongs to your Cloudvix account. A VPN protects your traffic on untrusted networks and gives you a fixed address; that is not the same as anonymity.

How much traffic can I use?

Quartz includes 1 TB a month. VPN traffic counts like any other traffic of the server; choose a plan with more vCPUs if you need more.

Do I need to open a port?

WireGuard listens on UDP port 51820. If you run a firewall on the server, such as ufw, allow that port, for example with ufw allow 51820/udp.

How do I add more devices?

Give each device its own key pair and its own address in 10.8.0.0/24 (10.8.0.3, 10.8.0.4 and so on), add one Peer block per device to wg0.conf and run systemctl restart wg-quick@wg0.

Does Cloudvix run the VPN for me?

No. You get a server with root access and set WireGuard up yourself. Keys, updates and the firewall are yours to look after.

Your own WireGuard VPN on a Cloud Server

Quartz · €0.0067 / hour · at most €4.49 / month per server

Create a server for WireGuard