Assuming that you are using a vanilla Debian 13 image, we will need some packages:
su - apt install sudo usermod -aG sudo your_username exit # Log out and back in for sudo group to take effect
In case you would like to set up a custom SSH port, do the following after logging in again:
sudo nano /etc/ssh/sshd_config # Find and uncomment + change to your preferred port number Port 2222 # Save and exit the editor, restart SSH sudo systemctl restart ssh # Now you can connect to your custom port
At this point you could consider installing ufw or another local firewall. You would then need to ensure the ports that we mention below are opened.
Now let’s install docker and other dependencies:
sudo apt update && sudo apt upgrade -y
sudo apt install -y curl wget git vim net-tools ca-certificates gnupg lsb-release
# Create a monitoring folder structure:
sudo mkdir -p /opt/monitoring/{data,config}
sudo mkdir -p /opt/monitoring/data/{prometheus,loki,grafana}
sudo chown -R $USER:$USER /opt/monitoring
If you use Ansible (or even AWX or Semaphore) for automation, remember to add your SSH key:
# 1. Create the 'ansible' user with no password. # -m creates the /home/ansible directory. # -s /bin/bash sets their shell. sudo useradd -m -s /bin/bash ansible # Lock the user - disable password-based login sudo passwd -l ansible # 2. Give the user passwordless sudo sudo visudo # Add this line at the very end of the file. Save and exit. ansible ALL=(ALL) NOPASSWD: ALL # 3. Create the .ssh directory and file as the 'ansible' user sudo -u ansible mkdir /home/ansible/.ssh sudo -u ansible chmod 700 /home/ansible/.ssh sudo -u ansible touch /home/ansible/.ssh/authorized_keys sudo -u ansible chmod 600 /home/ansible/.ssh/authorized_keys # 4. Open the file and paste your key sudo -u ansible nano /home/ansible/.ssh/authorized_keys ssh-ed25519 your_pre-existing_key # Paste the key from the clipboard. Save & exit.
Install Docker using the official Debian 13 method:
# Add Docker's official GPG key sudo install -m 0755 -d /etc/apt/keyrings curl -fsSL <https://download.docker.com/linux/debian/gpg> | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg sudo chmod a+r /etc/apt/keyrings/docker.gpg # Add the repository echo \\ "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] <https://download.docker.com/linux/debian> \\ $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \\ sudo tee /etc/apt/sources.list.d/docker.list > /dev/null # Install Docker sudo apt update sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin # Add your user to docker group (so you do not need sudo for docker commands) sudo usermod -aG docker $USER # Log out and back in, then verify docker --version docker compose version
Now when we have the basics, let’s set up our docker containers and start the fun!