Themes: Data Ownership, Server
Status: 🌱
Tags: resource

Docker Installation


Docker

Docker is a containerization platform that allows self-hosted applications to run in isolated environments called containers. It makes deploying, managing, updating, and backing up self-hosted applications much easier. It does not include a graphical interface and is primarily administered through terminal commands.

  1. Using the terminal in VS Code, install the prerequisites using the following command
sudo apt update
sudo apt install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings  

Command Breakdown

  • sudo apt update Updates the list of available software.
  • sudo apt install ca-certificates curl Installs tools for secure downloads.
  • sudo install -m 0755 -d /etc/apt/keyrings Creates a folder for software security keys.
  1. Add the Docker GPG key
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc  

Command Breakdown

  • sudo curl ... Downloads Docker’s security key and saves it to the system.
  • sudo chmod a+r ... Allows all users to read the Docker security key.
  1. Add Docker repository
sudo tee /etc/apt/sources.list.d/docker.sources <<EOF
Types: deb
URIs: https://download.docker.com/linux/ubuntu
Suites: $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}")
Components: stable
Architectures: $(dpkg --print-architecture)
Signed-By: /etc/apt/keyrings/docker.asc
EOF  
  1. Install Docker
sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin  
  1. Verify Docker installation was successful
docker --version
sudo docker run hello-world

Folder Structure


Folder Structure

Maintaining a neat folder structure helps tremendously when it comes to problem-solving and server backups. This folder structure will be essential as you expand your server in the future.

  1. Click the add folder icon in the explorer column
  2. Name the folder “docker”
  3. Navigate to the folder by entering the following into the terminal
cd docker
code .

Command Breakdown

  • cd docker Moves into the docker folder.
  • code . Opens the current folder in Visual Studio Code.
  1. Create a new folder in the docker folder named “npm”
    • NGINX Proxy Manager container
  2. Create a new folder in the docker folder named “actual”
    • Actual Budget container

The directory structure should look like this:

/home/username/docker/
├── actual/
└── npm/

Back Matter


Next Step: NGINX Installation
Previous Step: Visual Studio Code Installation
Parent Page: Home Server Build Guide