How to set up your own VPN server

You need three things: a rented server (VPS) with Linux, SSH access to it and a VPN protocol on it. By hand, all of this is set up in the terminal. An app can do the same by itself — from the server's address and password, in about 15 minutes.

Updated

On this page

What you need

  • A VPS with Linux: Ubuntu, Debian, Fedora, CentOS, Rocky, AlmaLinux or Arch Linux. Ubuntu 24.04 is the easiest.
  • The server's IP address, the root login and a password — the host sends them after payment.
  • A VPN protocol. WireGuard is the fastest; VLESS Reality looks like an ordinary website to your ISP.
  • A client on every device that will connect.

How to set it up by hand

  1. 1

    Rent a server

    The cheapest plan at any host is enough. Pick the system when you order — Ubuntu 24.04 is the easiest.

  2. 2

    Log in over SSH

    From your computer: the server address, the root login and the password from the host's email. A fresh server installs its system updates in its first minutes — let it finish.

  3. 3

    Install the protocol

    The server program, keys, port and firewall rules differ from one protocol to another. Set them up following that protocol's guide.

  4. 4

    Open the port

    If the host has a firewall in its dashboard, open the protocol's port there. Otherwise the server runs, but devices can't reach it.

  5. 5

    Give out access

    Each device gets its own key or link. One key on two devices at the same time does not work: they knock each other off.

Which protocol to install

  • WireGuard — the simplest and fastest, if the network doesn't cut it.
  • AmneziaWG — WireGuard with masked packets. Just as fast.
  • VLESS Reality — from the outside it looks like an ordinary secure website.
  • Shadowsocks — simple and light, but at times unstable.
  • OpenVPN — for devices and routers that only understand .ovpn.

In Veli

The app sets up the server

In Veli: Profiles → Add → “Your own server”. Type the server address and password — user root and port 22 are already set. Click “Add the server”. Veli is already selected in the choice of protocol — click “Install Veli”. Need another protocol? Select it and the button changes.

The app logs in over SSH by itself, recognises the system and sets up the server in a few minutes. The server becomes a row in Profiles, and the protocol gets a “Connect” button. “Add a device” gives a QR code and a link for a phone. To your ISP, Veli looks like an ordinary website, and on the server it updates itself.

FAQ

Do I need to know Linux?

To set it up by hand — yes: commands, settings, the firewall. The app does it by itself over SSH. If you do need the terminal, “Terminal” on the server screen opens the server's console right in the app.

Can one server run several protocols?

Yes. Veli, VLESS Reality, AmneziaWG, WireGuard, Shadowsocks and OpenVPN can run side by side. The next one installs without touching the ones already there.

Can I do it without the app?

Yes. One line in the server's terminal installs Veli, and the veli command adds devices, updates and removes it. It is the same Veli the app installs.

Your own server from an address and password

Veli logs in to the server over SSH, recognises the system and sets up the protocol in a few minutes.