loading...

March 31, 2022

Home Server Basic Setup

This is a generic guide to get up and running with a home server running on Ubuntu. If you are using a Debain based operating system like Raspbian on the Raspberry Pi, these instructions should be close but, may require minor tweaks. This walkthrough was done with Ubuntu 20.04.

Update

sudo apt update

sudo apt upgrade

Install SSH

While not required, being able to manage your server via a remote terminal is handy.

sudo apt install openssh-server

sudo ufw allow ssh

Install Docker

Docker will allow us to install pre-configured containers of popular services. Using Docker cuts down on setup and maintenance time.

sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

sudo apt-get install docker-ce docker-ce-cli containerd.io

sudo usermod -aG docker $USER

sudo reboot

Install Docker Compose

sudo curl -L "https://github.com/docker/compose/releases/download/1.26.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

sudo chmod +x /usr/local/bin/docker-compose

sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose

Install Portainer

This step is optional. However, Portainer provides a helpful web interface for managing Docker containers.

mkdir ~/docker-data

docker volume create portainer

docker run -d -p 8000:8000 -p 9000:9000 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v ~/docker-data/portainer:/data portainer/portainer

Go to: http://IP-OF-YOUR-SERVER:9000 to create an admin user, select ”Local”, and click connect.

Networking

At this point, you probably want to configure a static IP address for your server so that you can always get to it. You can either setup Ubuntu for a static IP or configure your router for a static lease.

My personal preference is to configure my router versus setting IP addresses in the client because I find it easier to manage but, either option works.

Example router configuration for an Ubiqiti EdgeRouter-X DHCP static leases.

Posted in Home Server, LinuxTaggs: