VPS Remote Access: A Cheap Server Between You and Your Home Network

You set up a small server at home. Maybe it holds your photos, your notes, or a few files you want to reach from anywhere. Then you try to open it from a hotel room or a friend’s house, and nothing loads. Your home internet connection will not let outside traffic in.

VPS remote access is one fix for that. A VPS (virtual private server) is a computer in a data center that you rent by the month. You use it as a meeting point. Your home server calls out to it, your phone calls out to it, and the two of them can talk. This guide explains how that works, what you set up, and where it stops helping. It takes an evening if you have used a command line before. If you have not, you can still read it to decide whether the idea is worth your time.

Before you start

You need three things:

  • A home computer or small server that runs the service you want to reach.
  • A rented VPS. A low-end plan is enough, because this server only passes traffic along.
  • A device you want to connect from, such as a phone or laptop.

This guide does not cover choosing a hosting company, and it does not cover setting up the service itself. It also does not make you anonymous. It gives you a private path to your own things.

You can skip all of this if your home internet lets you open a door to the outside (many providers do) and you are comfortable doing that. It is also not for you if you only want to hide your browsing. A regular commercial VPN does that job with far less work.

Why a rented server helps

Most home connections sit behind NAT. That is a setup where many devices share one public address, and the router decides which traffic goes where. Outsiders cannot start a conversation with your home server unless you set up a forwarding rule (often called port forwarding). Some providers do not allow that at all.

A small VPS gets around the problem. A low-end VPS running WireGuard can make services on a computer behind NAT reachable from the internet [1]. WireGuard is a VPN protocol, which is the method an app uses to build an encrypted tunnel. It is known for being simple and fast, and it runs on Linux, Windows, macOS, BSD, iOS and Android [3].

Think of the VPS as a post office box. You never give out your home address. Your home server and your phone both visit the box, and they leave messages for each other there.

Meet Jake. He runs a photo server at home, and his internet provider will not let him forward ports. He rents a VPS, connects his home server and his phone to it, and now his phone can reach the photo server from anywhere. Nothing at his house had to change.

Set up the server

The exact commands depend on your hosting company and operating system, so follow the full guide for your system. The Hetzner Community tutorial and the Debian Wiki both cover Debian in detail [1][2]. Here is the shape of the job, in plain words.

Install WireGuard on the VPS

On modern Linux you may not need to install anything extra. WireGuard has been part of the Linux kernel since version 5.5 [2]. The kernel is the core of the operating system, so recent systems already include it.

Make a pair of keys

Each device in the setup gets two keys. They work as a pair. The public key is the half you can share, and the private key is the half you keep secret. The rule of thumb is that the private key does not leave the device it was generated on, but the public key does [1].

Debian’s guide says to protect the private key file with appropriate file permissions [2]. In practice, that means only the administrator account on the server should be able to read it.

WireGuard does not hand out keys for you. Key distribution is out of scope for the project [3]. You copy each public key to the other side by hand.

Open the door in the firewall

A firewall is a filter that decides which network traffic is allowed in or out. Your VPS probably has one. The WireGuard listening port must be opened in the server’s firewall [1]. A port is a numbered door that one kind of traffic uses. Without this step, nothing can reach the tunnel.

Add your devices

Give the VPS the public key of your home server and the public key of your phone. Give each of them the public key of the VPS. After that, each device gets its own private address inside the tunnel. This address is not reachable from the public internet, and any service listening on it can only be reached by clients connected to the VPN [1].

Keep your home server reachable

Your home server is behind NAT, so it has to reach out to the VPS first and keep that link open. WireGuard has a setting for this. A peer behind NAT or a firewall can send keepalive packets, which are tiny “I am still here” messages. A sensible interval that works with a wide variety of firewalls is 25 seconds [4].

This does not mean a constant stream of traffic. By default, WireGuard tries to be as silent as possible when not being used [4]. Your home server only adds the small keepalive messages so the path stays open.

There is a bonus for your phone. WireGuard can keep a connection going when a peer’s IP address changes [3]. An IP address is the number that identifies your connection, a bit like a return address on a letter. When you walk from home Wi-Fi to mobile data, the tunnel can carry on without you doing anything.

Keep your services private

This is where the setup earns its keep. Run internal services such as SSH (remote login), FTP (file transfer), and remote desktop on the VPN address instead of the server’s main public address. This reduces the ways an attacker can reach the server [1].

Here is the idea. Sarah has a small server for her family’s documents. If the login page sits on the public internet, anyone can try to guess the password. If it only listens on the tunnel address, a stranger cannot even see it.

Be careful when you make this change. You can lock yourself out of your own server. Always leave one service open to all addresses while you are making changes, in case something goes wrong [1]. Only close that last door once you have tested that the tunnel works.

The honest limits

A cheap VPS is a good tool, and it is not magic. Here is what it does not do.

It is not a firewall. A tunnel decides which packets are carried, not which services listen [5]. A server reachable over the tunnel is still reachable from the internet on any port you left open [5]. Setting up the tunnel is only half the job. You also have to close the doors you do not need.

Keys do not expire. Plain WireGuard keys never expire. A key you issued three years ago works forever unless you delete the peer block by hand [5]. If you lose a phone, remove its entry from the server that day. Keep a short list of which device has which key, so you know what to delete.

You now have one more computer to look after. The VPS needs updates and a sensible firewall like any other server. A rented server you forget about is a risk.

It does not make you anonymous. The VPS company knows who pays for it. This setup connects you to your own things privately. It does not hide you from the sites you visit. A VPN does not make you anonymous no matter what a sponsor read says.

It does not scale to a crowd. Self-hosted WireGuard setups are almost always hub and spoke, with one public server and clients that talk only to it [5]. Plain WireGuard suits one VPS and a few devices that connect to it [5]. If you want twenty devices that all talk to each other directly, a different tool may fit better.

If your needs go beyond a home setup, such as protecting a business or people at real risk, this is a job for a specialist. A blog post is not enough.

Common mistakes

  • Sharing the private key. Only public keys travel between devices [1]. If a private key leaves its device, make a new pair.
  • Forgetting the firewall. Without the listening port open, nothing connects [1]. With too many other ports open, the tunnel protects very little [5].
  • Locking yourself out. Leave one service open while you test, and close it last [1].
  • Skipping the keepalive on the home server. The path may close, and you will not reach it from outside until the server calls out again [4].
  • Never removing old devices. A forgotten key keeps working [5]. Delete the entry when a device is gone.

What you can skip

You do not need a fancy dashboard, a second VPS, or a map of every device. For one home server and a phone or two, the basic setup above is enough. You can also ignore anyone who says you must use a more complicated tool. Start small and add things only when you hit a real problem.

For the technically curious

WireGuard securely encapsulates IP packets over UDP [3]. UDP is a fast way of sending internet traffic that some strict networks, like hotel or office Wi-Fi, block. If the tunnel will not connect on a certain network, that may be the reason. Since the Linux kernel includes WireGuard from version 5.5 [2], the VPS needs no extra software on a current system.

Your next step

Write down what you want to reach and who needs to reach it. If the answer is one server and a few devices, a small VPS will do the job. Pick one service, put it behind the tunnel, and test it before you add another.

Then close the extra doors and go back to your life. Your home server stays at home, and only you know the way in.

Sources

  1. Install and configure WireGuard VPN on Debian (Hetzner Community)
  2. WireGuard – Debian Wiki
  3. WireGuard: fast, modern, secure VPN tunnel
  4. Quick Start – WireGuard
  5. WireGuard vs Tailscale (SSD Nodes Learn)

Leave a Comment