We may earn a commission if you sign up through links on this site, at no extra cost to you. Full disclosure.

Run Your Own VPN on DigitalOcean

A personal WireGuard VPN costs $4/mo on the smallest Droplet, which undercuts every commercial VPN. It's also the guide on this site where the honest caveats matter most, because a self-hosted VPN solves a narrower problem than the marketing around VPNs suggests.

Read this before you build it

A personal VPN is excellent for securing your traffic on untrusted networks and for reaching your own servers privately. It is not anonymity. Your Droplet has a static IP registered to your name and payment card, and all your traffic exits through it — so rather than your ISP seeing your browsing, DigitalOcean can, and the IP ties directly back to you. For privacy from your ISP on hotel wifi, this is great. For anonymity, it's worse than a commercial VPN and far worse than Tor.

What it costs

DropletPriceIncluded transferRealistic use
512 MiB / 1 vCPU$4/mo500 GiBOne or two people, general browsing
1 GiB / 1 vCPU$6/mo1,000 GiBA household, some video streaming
2 GiB / 1 vCPU$12/mo2,000 GiBHeavy streaming or a small team

This is the one use case where the $4 Droplet is genuinely the right size — WireGuard is extremely light on CPU and memory. Bandwidth is what you're actually buying, and transfer scales with the Droplet tier. Streaming HD video runs roughly 3 GB an hour, so 500 GiB is around 175 hours of video a month. Overage is billed separately, so check your usage if you plan to stream heavily.

Setting it up

About twenty minutes. The Marketplace image includes a web admin panel, so you don't have to hand-edit WireGuard configs.

1. Pick your region deliberately

Your traffic will appear to come from the Droplet's datacenter. Choose the region for the country you want to appear in, and remember that distance adds latency — a VPN on the other side of the world will make everything feel slower.

2. Deploy the VPN Server image

Create a Droplet from the Marketplace VPN Server 1-Click image, which runs WireGuard on Ubuntu 24.04 with an admin web interface. The smallest Droplet is fine. Add an SSH key at creation.

3. Get the setup code

SSH in with ssh root@your_droplet_ip and run cat /vpn/setup-code.txt. You'll need that secret to claim the admin interface.

4. Open the admin panel over http, then enable TLS

Visit http://your_droplet_ip — deliberately http, not https, because TLS isn't configured yet and https will error. Enter the setup code, then turn on TLS from inside the panel as your first action.

5. Create users and connect devices

Create a user in the admin panel for each device or person. Install the official WireGuard client on your phone or laptop and import the configuration file, or scan the QR code. Connecting takes seconds — WireGuard is dramatically simpler than OpenVPN here.

What this does and doesn't do

Genuinely good for

  • Encrypting your traffic on public wifi so the network operator can't inspect it.
  • Hiding your browsing from your home ISP, if you'd rather DigitalOcean have it than them.
  • Reaching your own private servers and databases securely without exposing them publicly.
  • A fixed, known exit IP you can allowlist on other services.
  • Cost: one Droplet covers your whole household, versus per-user commercial pricing.

Doesn't do

  • Anonymity. The IP is yours, tied to your account and card. A commercial VPN at least mixes you with thousands of other users; here, traffic from that IP is unambiguously you.
  • Streaming geo-unblocking. Datacenter IP ranges are widely blocked by the major streaming services, and DigitalOcean's are well known. Assume this won't work.
  • Protection from tracking. Cookies, fingerprinting, and logging into accounts identify you regardless of IP.
  • A no-logs promise. DigitalOcean is a normal company subject to normal legal process, and you agreed to their terms.

Maintaining it

Lighter than the other guides here, but not zero. You're running an internet-facing server with an admin panel, so:

Patch the OS

Ubuntu security updates still apply. A VPN server is a high-value target precisely because all your traffic goes through it.

Protect the admin panel

Enable TLS immediately, use a strong password, and restrict access where you can. An exposed VPN admin interface is worse than no VPN.

Watch your bandwidth

Transfer is the resource you'll actually exhaust. Set a billing alert so a month of heavy streaming doesn't surprise you.

Is this right for you?

Yes, if you travel and use untrusted networks, want private access to your own infrastructure, or want to cover a household for $4 rather than paying per seat. Those are real, well-served use cases.

No, if what you actually want is anonymity or to watch region-locked content. A self-hosted VPN is the wrong tool for both, and no amount of configuration fixes that. If anonymity genuinely matters for your safety, research Tor and threat modelling properly rather than relying on any VPN.

FAQ

How many devices can I connect?

As many as you like — you create a config per device in the admin panel. Bandwidth, not device count, is the practical limit.

Will it work in countries that block VPNs?

Sometimes, and less reliably over time. WireGuard traffic is identifiable by deep packet inspection, and a single static IP is easy to block once noticed. If you're relying on this to reach the internet under a censoring government, understand that it may fail and that the traffic is attributable to you.

How fast is it?

WireGuard is fast enough that your Droplet's network and the distance to the datacenter are the limits, not the encryption. A nearby region usually costs you very little throughput.

Is this cheaper than a commercial VPN?

Usually, especially for a household — $4/mo covers everyone. But commercial VPNs offer many exit countries, shared IPs, and no maintenance. You're buying different things.

Can I run the VPN on a Droplet I already use for something else?

You can, but don't. Routing your personal traffic through your web server mixes concerns and means a compromise of either affects both. At $4, a dedicated Droplet is the right call.

A personal VPN from $4/mo

WireGuard on the smallest Droplet, with a web admin panel. Covers every device you own.

Get started with DigitalOcean

Affiliate link — we may earn a commission at no extra cost to you.

← All DigitalOcean guides