Creating a Simple Docker Home Server
1. Starting from Scratch
If you already have Ubuntu 22.04 installed on your Blade 3, you can skip to step 2.
I used Mixtile’s guides to upgrade the Blade 3 firmware using “Raw Image”: Updating Firmware with MaskROM Mode. You can find the guide at: https://www.mixtile.com/docs/update-firmware-with-maskrom-mode/
This involves imaging the Blade 3 by connecting it to another PC via the USB-C data port. I used my Mac and got the Blade 3 imaged with the ubuntu-22.04.2-preinstalled-desktop image as per the guide.
2. Prepping Ubuntu
Update your system by running the following commands in the terminal:
'sudo apt update'
'sudo apt upgrade'
Then, use the Ubuntu Software Updater to update to version 22.04.4.
3. Install Docker
Docker is a platform that allows you to develop, ship, and run applications inside containers. Here’s how to install Docker on Ubuntu 22.04.4:
Step 3.1: Install Prerequisites
Before installing Docker, make sure your system has the necessary prerequisites by running the following command:
'sudo apt install apt-transport-https ca-certificates curl software-properties-common'
Step 3.2: Add Docker’s Official GPG Key
Add Docker’s official GPG key to ensure the authenticity of the Docker packages by running the following command:
'curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg'
Step 3.3: Set Up the Docker Repository
Add the Docker repository to the APT sources by running the following command:
'echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null'
Step 3.4: Install Docker Engine
Update the package database with the Docker packages from the newly added repository by running the following command:
'sudo apt update'
Use Docker’s Convenience Script:
'curl -fsSL https://get.docker.com -o get-docker.sh'
'sudo sh get-docker.sh'
Step 3.5: Verify Docker Installation
Check that Docker is installed correctly by running the hello-world image:
'sudo docker run hello-world'
This command downloads a test image and runs it in a container. When the container runs, it prints a confirmation message and exits.
Step 3.6: Manage Docker as a Non-Root User
To avoid typing すど whenever you run the docker command, add your username to the Docker group:
'sudo usermod -aG docker ${USER}'
Apply the new group membership:
'su - ${USER}'
Ensure Docker starts on boot and start the Docker service:
'sudo systemctl enable docker'
'sudo systemctl start docker'
4. Install Jellyfin
Jellyfin is an open-source media server that allows you to manage and stream your media files.
Step-by-Step Instructions
1. Create Directories for Configuration and Data:
'mkdir -p ~/jellyfin/config'
'mkdir -p ~/jellyfin/cache'
2. Run Jellyfin Container:
'docker run -d --name=jellyfin -e PUID=1000 -e PGID=1000 -e TZ=Etc/UTC -p 8096:8096 -p 8920:8920 -v ~/jellyfin/config:/config -v ~/jellyfin/cache:/cache -v /path/to/your/media:/media --restart unless-stopped jellyfin/jellyfin'
Access Jellyfin Interface:
Open your web browser and navigate to http://YOUR_DOCKER_IP:8096 to access the Jellyfin web interface.
5. Install Pi-hole Using Docker
Remove Existing Pi-hole Container:
'docker stop pihole'
'docker rm pihole'
Create Directories for Configuration and Data:
'mkdir -p ~/pihole/etc-dnsmasq.d'
'mkdir -p ~/pihole/etc-pihole'
Run Pi-hole Container with Alternate Ports:
'docker run -d --name pihole -p 5454:53/tcp -p 5454:53/udp -p 8181:80/tcp -e TZ="Etc/UTC" -v ~/pihole/etc-pihole:/etc/pihole -v ~/pihole/etc-dnsmasq.d:/etc/dnsmasq.d --dns=1.1.1.1 --dns=8.8.8.8 --restart=unless-stopped pihole/pihole'
Accessing Pi-hole Web Interface
Open your web browser and navigate to http://YOUR_DOCKER_IP:8181/admin to access the Pi-hole web interface.
6. Install Nextcloud
Create Configuration and Data Directories:
'mkdir -p ~/nextcloud/data'
'mkdir -p ~/nextcloud/config'
'mkdir -p ~/nextcloud/apps'
Run Nextcloud Container with Unique Ports:
'docker run -d --name nextcloud -p 8081:80 -v ~/nextcloud/data:/var/www/html/data -v ~/nextcloud/config:/var/www/html/config -v ~/nextcloud/apps:/var/www/html/apps --restart unless-stopped nextcloud'
Setting or Resetting the Pi-hole Admin Password
Set or Reset the Password: Run the following command to set or reset the Pi-hole admin password:
'docker exec -it pihole pihole -a -p'
Enter the New Password: You will be prompted to enter a new password. Enter the password you wish to use for the Pi-hole admin interface.
Access Nextcloud Interface:
Open your web browser and navigate to http://YOUR_DOCKER_IP:8081
Credits
Dual-Wielding Dad
YouTuber focusing on open-source tech for everyday people. East Carolina University College of Engineering & Technology alumnus.