Update #16 - Installing Docker and Prepping My VPS for App Expandability.
Date: May 23, 2025
Category: Server Management / DevOps
Backlink: N/A (First Entry in Docker Expansion Series)
My objective was to get Docker up and running on my existing VPS without migrating BookStack (yet). I wanted to ensure I could containerize and run additional apps while keeping BookStack fully operational, with no downtime during this transition. This setup gives me the flexibility to explore other projects in isolated environments while preserving my current production setup.
Setting this up can be found here: https://docs.docker.com/engine/install/ubuntu/
I'll run apt update to make sure my packages are updated.
sudo apt update
I also used app auto-remove to get rid of some old PHP packages:
sudo apt autoremove
So to install Docker, we need to build our app source line step-by-step.
Getting my system architecture:
dpkg --print-architecture
So I see it is amd64
I'll also need to get my Ubuntu Codename:
lsb_release -cs
So I see it is jammy
Now I can construct the Docker source line manually:
echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu jammy stable"
This code below writes it into the APT sources list at /etc/apt/sources.list.d/docker.list
echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu jammy stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
Now we can update the packages:
sudo apt update
I got an error like this
So I need to re fetch and add Docker's GPG Key Securely:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | \
sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
Then enure it is readable by APT:
sudo chmod a+r /etc/apt/keyrings/docker.gpg
Then update the package list again:
sudo apt update
Proceed with installing Docker:
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
This installs the docker engine, CLI Tools, Container runtime,, and Docker Compose plugin (V2)
I left both services checked for restart and verified everything is installed.
I'm now ready to use docker for some of my other projects and also didn't bring down the Bookstack at all while doing this.
Now I can enable docker with these commands:
sudo systemctl enable docker
sudo systemctl start docker
sudo usermod -aG docker $USER
# Logout and back in or run: su - $USER
Testing the docker installation:
docker run hello-world
See the docker compose version:
docker compose version
Now I can make some project directories and change ownership and look at this for reference on where the projects will go:
This makes 3 different folder projects:
sudo mkdir -p /opt/docker/{bookstack,uptime-kuma,portainer}
Now I can change ownership to my user for these folders:
sudo chown -R $USER:$USER /opt/docker
I'm officially Docker ready.
No Comments