Home of internet privacy

How to set up your own home server

This guide requires you to use the command line interface, or CLI, and an SSH client. SSH (Secure Shell) is a popular tool to “remote control” devices securely. In principle, it functions similarly to a VPN, with the exception that you gain access to a computer, rather than the entire internet.

Windows

Windows 10 has a native command line interface, though it might not be installed by default. To install it:

  1. Go to Settings > Apps
  2. Click Manage optional features under Apps & features

If an SSH client is installed on your machine it should appear here. If not, you can add it by clicking “Add a Feature” and then choose “OpenSSH Client.” Don’t install the OpenSSH Server.

To use the SSH client, you need to first open a PowerShell, which can be done by right-clicking the Start Menu or by pressing Windows+X and then selecting the PowerShell.

Once you have launched the PowerShell you enter SSH to be ready.

Mac OS

Open the terminal with Spotlight, the Launch Pad, or Finder.

Linux

Open the command line with Ctrl+Alt+T

Useful tips when using the command line

Get a Virtual Private Server

Any server will do. With little effort, you can even convert an old laptop or use a Mini PC for ~US$100. Even a computer as small as a Raspberry Pi will theoretically suffice.

In our case, we will rent a Virtual Private Server (VPS) from Lunanode. We chose Lunanode because it’s relatively easy to sign up without identification; they accept Bitcoin and are reliable. Another great alternative is Cryptohost (who even take Lightning!). More pricey, but also requiring less personal information for sign up is Njal.la.

Alternatively, you may also opt to choose one of the larger providers such as AWS, Digital Ocean, or Rackspace.

Sign Up

To sign up to Lunanode, you’ll need to verify your email address and phone number, then select your country and choose a password. You can immediately deposit Bitcoin into your account to start paying for your server or enter a credit card to bill you automatically.

Pricing

We recommend the m2 server for US$7 per month. And we’ll add 80GB of storage for an extra $2.7 per month.

Find your SSH key

Add your SSH key

In your Lunanode dashboard, find the option ‘SSH Keys’ on the left side. Give your SSH key a name and paste the contents of your notepad in its entirety into the public key field, then click ‘Add SSH Keypair.’ It should then appear in the list.

Launch your server

To create your virtual machine, click on ‘Create VM’ on the top left corner of your Lunanode dashboard. Choose a location, plan, and operating system, then decide on a hostname. In our case, that is Toronto, m2 on Ubuntu 18.04 (64bit) and we named it Torontola. You’ll also need to add your keypair so you can securely log in.

Log into your server

Under ‘virtual machine’ you should see your instance now. Click on its name and you should see, among others, its external IP address. You can log into your server by opening up a Terminal window and entering the command:

ssh ubuntu@

for example: ssh ubuntu@192.168.1.1

Since it’s your first login, you will likely be told the authenticity of your host couldn’t be confirmed. Enter yes to add your machine to your list of trusted devices. You’ll be warned again if the key changes.

Configure your server

We’ll set up a simple firewall to protect the server. Ufw (uncomplicated firewall) should be pre-installed on your machine. You can see if it’s installed or enabled by typing sudo ufw status

If you aren’t shown a “Status” message in response you can install it with sudo apt install ufw

Most important, we’ll need to enable SSH so that we can continue to log into our machine remotely. We can only skip this step if we have direct access to the server, meaning we can plug a monitor and keyboard into it. If we can’t, we must enable SSH with sudo ufw allow ssh

Now we can turn the firewall on with sudo ufw enable

Update your server

Make sure that your server is up to date by running the commands sudo apt update and sudo apt upgrade.

Now you’re all set!