Host Your Own VPN Server for DIY VPN
A plain-English guide to setting up a WireGuard® or OpenVPN® server — no experience needed.
DIY VPN turns your Apple TV into a VPN client. It connects to a VPN server and sends the Apple TV’s internet traffic through it. DIY VPN doesn’t come with a server — you bring your own. This guide shows you how to set one up, step by step, even if you’ve never done anything like this before.
What is a VPN server? A VPN (virtual private network) is a private, scrambled connection between your device and a computer you control, called the server. Websites and apps see the server’s internet address instead of your Apple TV’s.
Why run your own?
• Use your home internet connection while you’re away — for example, to reach devices and services on your home network.
• Keep your viewing private on hotel, dorm, café, or other shared Wi-Fi.
• Know exactly who runs the server: you. No subscription, and no company in the middle.
Before you start
What you’ll need
• An Apple TV with DIY VPN installed.
• A phone or computer on the same Wi-Fi network as the Apple TV. You’ll use it to send the profile to the TV.
• About 30 minutes.
• If you rent a cloud server (explained below): a payment card. Expect about $4–6 a month.
Words you’ll see
• Server — a computer that stays on and connected to the internet.
• IP address — a computer’s address on the internet: four numbers separated by dots, like 203.0.113.25.
• Port — a numbered “door” at that address. Different programs listen at different doors.
• Terminal — a window where you type commands instead of clicking. On a Mac it’s called Terminal (in Applications → Utilities). On Windows, use PowerShell (search for it in the Start menu).
• SSH — a secure way to log in to a server from your terminal.
• Profile — a small file that tells DIY VPN how to reach your server: a .conf file for WireGuard or an .ovpn file for OpenVPN. It contains secret keys, so keep it private.
WireGuard or OpenVPN?
DIY VPN works with both. If you’re not sure, pick WireGuard.
• WireGuard (recommended for most people) — newer, faster, and simpler. Setup takes a few minutes and connections are quick.
• OpenVPN — older and supported almost everywhere. Choose it if you already have an OpenVPN server, or if you’ll be on networks that block VPNs. OpenVPN can use TCP port 443, the same door that ordinary secure websites use, which makes it hard to block.
You can set up both on the same server and keep both profiles in DIY VPN.
Step 1: Choose where your server lives
Option A: Your router or network storage box (easiest, if yours can do it)
Many home routers and network storage boxes (NAS) have a VPN server built in — for example, models from ASUS, GL.iNet, Synology, and Ubiquiti UniFi, some TP-Link and Netgear models, and pfSense or OPNsense firewalls. If yours has one, you don’t need to buy or install anything.
Every brand’s menus are different, so search your router maker’s help pages for “VPN server.” The general steps are:
1. Open your router’s settings page or app and sign in.
2. Find VPN Server. It’s often under Advanced or VPN.
3. Turn on WireGuard or OpenVPN.
4. Add a client (sometimes called a profile or peer) and name it “appletv.”
5. Export or download the profile. You’ll get a .conf file (WireGuard) or an .ovpn file (OpenVPN).
6. Read “Extra steps when the server is at home” below. You can skip port forwarding because the router is the server, but the other parts still apply. Then go to Step 3.
Option B: Rent a small cloud server (works from anywhere)
A cloud server is a computer you rent in a data center. Popular providers include DigitalOcean, Vultr, Akamai (Linode), Hetzner, and Amazon Lightsail. The smallest plan, about $4–6 a month, is plenty for a personal VPN.
When you create the server (it may be called a “Droplet,” “Instance,” or “Server”), choose:
• Operating system: Ubuntu, the newest version marked LTS (long-term support).
• Plan: the cheapest one.
• Location: near where you want your internet to appear to come from — usually near your home.
• Login: a password is simplest. If the provider offers “SSH keys,” those are more secure and work too.
When it’s ready, write down the server’s IP address and password. Then follow Step 2A (WireGuard) or Step 2B (OpenVPN).
Good to know: Streaming services often block addresses that belong to cloud providers. If you mainly want your Apple TV to behave as if it’s at home, host the server at home (Option A or C) instead.
Option C: A spare computer or Raspberry Pi at home
PiVPN is a free installer that sets up WireGuard or OpenVPN on a Raspberry Pi, or another Debian- or Ubuntu-based computer that stays switched on. In that computer’s terminal, type:
curl -L https://install.pivpn.io | bash
It walks you through each choice on screen. When it finishes, make a profile by typing pivpn add. The profile is saved in a folder called configs in your home folder. Then read “Extra steps when the server is at home” below, and go to Step 3. (PiVPN is run by volunteers on a best-effort basis.)
Step 2A: Set up WireGuard on a cloud server
We’ll use wireguard-install, a free, open-source script that asks a few questions and does the rest.
Log in to your server
1. Open Terminal (Mac) or PowerShell (Windows).
2. Type the line below, replacing YOUR.SERVER.IP with your server’s IP address, then press Return (Enter on Windows). If your provider gave you a different user name — Amazon Lightsail uses ubuntu — type that instead of root.
ssh root@YOUR.SERVER.IP
3. The first time, you’ll see “Are you sure you want to continue connecting (yes/no/[fingerprint])?” Type yes and press Return. This is normal: your computer is meeting the server for the first time.
4. Type the server’s password and press Return. Nothing appears on screen while you type — that’s normal. The password is hidden for safety.
You’re in when the last line looks something like root@your-server:~#.
Tip: Many providers have a Console or Connect button on the server’s page that opens this same window in your web browser. That works too, and you can skip the steps above.
Run the installer
5. Copy this whole line, paste it into the server window, and press Return. (To paste: ⌘V on a Mac; right-click or Ctrl+V in PowerShell.)
wget https://raw.githubusercontent.com/Nyr/wireguard-install/master/wireguard-install.sh -O wireguard-install.sh && sudo bash wireguard-install.sh
6. Answer the questions. Pressing Return accepts the suggested answer shown in [brackets], which is right for most people:
– “Public IPv4 address / hostname” or “Which IPv4 address should be used?” — only some servers ask. Press Return.
– “Port [51820]” — press Return.
– “Name [client]” — type appletv and press Return.
– “DNS server [1]” — press Return. (DNS is the internet’s phone book. Option 3, 1.1.1.1, is a good alternative.)
– If it asks about automatic updates for BoringTun, press Return to say yes.
– “Press any key to continue…” — press any key.
7. Wait a minute or two. When it’s done, you’ll see Finished!, a large square QR code (that’s for phones — you can ignore it), and a line like:
The client configuration is available in: /root/appletv.conf
That file is your WireGuard profile.
Copy the profile to your computer
Way 1: copy and paste (works everywhere, including browser consoles)
8. In the server window, type this and press Return:
sudo cat appletv.conf
9. The profile appears on screen. It starts with [Interface]. Select everything from [Interface] down to the last line, and copy it.
10. Open a plain text editor. On a Mac, open TextEdit and choose Format → Make Plain Text before pasting. On Windows, open Notepad.
11. Paste, and save the file as appletv.conf. On a Mac, if asked, choose “Use .conf.” On Windows, set “Save as type” to “All files.” If your computer adds .txt to the end anyway, that’s fine — DIY VPN looks at what’s inside the file.
Way 2: download it directly (Mac, or Windows 10 and 11)
Open a new terminal window on your computer — don’t log in to the server in this one — and type the line below. Use the same user name you logged in with.
scp root@YOUR.SERVER.IP:appletv.conf .
Enter your password when asked. The dot at the end means “put it here,” which is your home folder. On a Mac, open Finder and choose Go → Home. On Windows, look in C:\Users\YourName.
Now go to Step 3 to put the profile on your Apple TV.
Step 2B: Set up OpenVPN on a cloud server
This works just like Step 2A, using the companion script openvpn-install.
1. Log in to your server as described in Step 2A (steps 1–4), or use your provider’s Console button.
2. Copy this whole line, paste it into the server window, and press Return:
wget https://raw.githubusercontent.com/Nyr/openvpn-install/master/openvpn-install.sh -O openvpn-install.sh && sudo bash openvpn-install.sh
3. Answer the questions. Return accepts the suggestion in [brackets]:
– “Public IPv4 address / hostname” or “Which IPv4 address should be used?” — only some servers ask. Press Return.
– “Which protocol should OpenVPN use?” — press Return for UDP (recommended). Choose 2 (TCP) only if you’ll be on networks that block VPNs.
– “Port [1194]” — press Return. If you chose TCP to get through strict networks, type 443 instead.
– “DNS server [1]” — press Return.
– “Name [client]” — type appletv and press Return.
– “Press any key to continue…” — press any key.
4. When it’s done you’ll see Finished! and a line like “The client configuration is available in: /root/appletv.ovpn”.
5. Copy the profile to your computer the same way as in Step 2A, using appletv.ovpn instead of appletv.conf:
sudo cat appletv.ovpn
or, from a new terminal window on your computer:
scp root@YOUR.SERVER.IP:appletv.ovpn .
An .ovpn file is longer than a WireGuard one. It contains several blocks of random-looking text — those are its certificates and keys. If you copy and paste, copy all of it, from the first line (client) to the very last line.
Usernames and passwords: Profiles made with this installer use built-in certificates, so there’s no username or password to enter. If you use a different OpenVPN server that does ask for one, DIY VPN handles that too — see Step 3.
Step 3: Put the profile on your Apple TV
1. On your Apple TV, open DIY VPN and go to the Import tab. It shows a web address (something like http://192.168.1.20:8080) and a 6-digit PIN.
2. On a phone or computer connected to the same Wi-Fi, open a web browser and type that exact address.
3. Enter the PIN and select Unlock.
4. Under Add profiles, choose your appletv.conf or appletv.ovpn file (you can choose several at once), then select Upload.
5. Only if your OpenVPN server needs a username and password: on the same web page, find the profile, open Username & password, type them in, and select Save credentials. It’s much easier than typing with the remote!
6. Back on the Apple TV, go to Profiles and select Use next to your new profile.
7. Go to Connection and select Connect. The first time, your Apple TV may ask whether DIY VPN can add a VPN configuration. Choose Allow.
When the screen says Connected, your Apple TV’s internet traffic is going through your own server.
Keep in mind: The upload page only works while the Import screen is open on the TV, and the PIN changes each time the screen opens. That keeps the page off your network the rest of the time.
Extra steps when the server is at home
Skip this section if you used a cloud server.
Port forwarding: let VPN traffic in
Your router normally blocks connections that start on the internet. Port forwarding is a rule that tells it: “When VPN traffic arrives at this door, send it to my VPN computer.”
• WireGuard: forward UDP port 51820.
• OpenVPN: forward UDP port 1194, or the port and protocol you chose.
Look for Port Forwarding, Virtual Server, or NAT in your router’s settings. Point the rule at your VPN computer’s local address (it usually starts with 192.168. or 10.). It also helps to give that computer a fixed local address — look for “DHCP reservation” or “static IP” — so the rule keeps working. If your router itself is the VPN server, you don’t need port forwarding.
Dynamic DNS: a name that follows your home address
Most home internet addresses change from time to time. When yours changes, your profile still points at the old address and stops working. Dynamic DNS gives your home a name (like myhome.duckdns.org) that always points to your current address. Many routers have it built in — look for DDNS — and services such as DuckDNS and No-IP offer free names. Set it up first, then use that name as the server address when your setup asks for one.
When home hosting won’t work (CGNAT)
Some internet providers — especially 5G home internet and satellite services — share one internet address among many customers. This is called CGNAT, and it means nothing on the internet can reach your home, even with port forwarding.
A quick check: compare the “WAN” or “Internet” address on your router’s status page with the address shown at whatismyipaddress.com. If they’re different, you’re probably behind CGNAT. Ask your provider whether they offer a “public IP address” (sometimes free, sometimes a small fee), or use a cloud server instead.
Keeping it safe
• Treat profile files like house keys. Anyone who has one can use your VPN. Don’t email them around or post them anywhere, and delete extra copies once they’re on your Apple TV.
• Use one profile per device. Make a separate profile for each device — “appletv,” “phone,” “laptop.” A WireGuard profile can only be connected from one device at a time, and separate profiles let you cut off one device without affecting the rest. To add one, run the installer again (sudo bash wireguard-install.sh or sudo bash openvpn-install.sh) and choose Add a new client.
• Lost a device? Run the installer again and choose Remove an existing client (WireGuard) or Revoke an existing client (OpenVPN). That profile will no longer be able to connect.
• Keep your server up to date. Ubuntu usually installs security fixes on its own, but about once a month, log in and run the command below. If it says a restart is required, type sudo reboot. Your VPN starts again by itself afterward.
sudo apt update && sudo apt upgrade -y
• Keep your server to yourself. Don’t share its login. Use a strong, unique password for the server and for your cloud provider account, and turn on two-step sign-in if your provider offers it.
If something goes wrong
It says Connected, but nothing loads
Restart the server (type sudo reboot in the server window, or use the restart button on your provider’s page) and try again. For WireGuard, you can also make a new profile and choose DNS option 3 (1.1.1.1). If the server is at home, check that the VPN computer itself has a working internet connection.
It never connects
• Make sure the server is switched on. Your provider’s dashboard should show it as running.
• Check the provider’s firewall. Some providers — Amazon Lightsail in particular — block everything except a few doors until you open them. In the server’s Networking or Firewall settings, allow UDP 51820 for WireGuard or UDP 1194 for OpenVPN (or the port and protocol you chose).
• At home, double-check port forwarding and read the CGNAT section above.
• DIY VPN’s Connection tab shows the error the VPN reported. It often points straight at the problem.
The upload page won’t open
• Your phone or computer must be on the same Wi-Fi as the Apple TV — not cellular data, and not a separate guest network.
• The Import screen must be open on the TV.
• Type the address exactly as shown, including http:// (not https) and :8080 at the end.
• If you enter the wrong PIN five times in a row, the page makes you wait 30 seconds before you can try again. This stops strangers from guessing it. Wait, then type the PIN exactly as it appears on the TV.
• If your Apple TV asked whether DIY VPN may connect to devices on your local network, that permission needs to be allowed.
A profile says it needs a username and password
The server behind that profile requires a login. Open the upload page, find the profile, open Username & password, enter them, and select Save credentials.
The file was rejected
• Make sure you uploaded the profile itself (the .conf or .ovpn file), not a screenshot or a document about it.
• If you copied and pasted the profile, it must be saved as plain text. Files saved from Word, or as .rtf or .docx, won’t work.
• Copy the whole profile, including the first and last lines.
• The upload page shows the reason a file was rejected, which tells you what to fix.
That’s it!
You now run your own VPN, on a server you control. If you have questions or feedback about DIY VPN, contact CyberWisp.
