Installing the Latest Docker and Docker Compose on Ubuntu Server 24.04¶
This guide ensures you install the latest Docker Engine and Docker Compose on Ubuntu Server 24.04 (Noble), using the official Docker repositories.
Step 1: Update the System¶
Ensure your system is up to date before installing any packages:
Step 2: Install Required Dependencies¶
Install required system packages:
Step 3: Add Docker’s Official GPG Key¶
Docker packages are signed, so we need to add the official GPG key:
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo tee /etc/apt/keyrings/docker.asc > /dev/null
sudo chmod a+r /etc/apt/keyrings/docker.asc
Step 4: Add the Docker Repository (For Ubuntu 24.04 Noble)¶
Now, add the Docker stable repository to your system:
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu noble stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
Then update the package index again:
Step 5: Install Docker Engine and Docker Compose Plugin¶
Now, install the latest versions of Docker and the Compose plugin:
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
Step 6: Enable and Start the Docker Service¶
Ensure that Docker starts on boot and is currently running:
Check the service status:
Step 7: Verify Installation¶
Check that Docker is installed correctly:
Verify the Docker Compose plugin:
Run a test container to ensure everything works:Step 8: Add Your User to the Docker Group (Optional, for Non-root Access)¶
By default, you need sudo to run Docker commands. To run Docker as a regular user, add yourself to the docker group:
IMPORTANT: Log out and back in to apply group membership¶
Do NOT use 'newgrp docker' — it temporarily changes your primary group and may cause permission issues¶
Now test running Docker without sudo:
Step 9: Keeping Docker and Compose Updated¶
Since Docker releases frequent updates, update your system regularly:
For a more targeted update, check if a new Docker version is available:
Then update Docker only:
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
Final Verification¶
After completing the steps, verify the installation one last time:
At this point, you have the latest Docker and Docker Compose installed on Ubuntu 24.04, fully functional and ready to use.
¶
Final Step: Install Watchtower for Automatic Container Updates AFTER application installation¶
Watchtower automatically updates your running Docker containers when new versions are available. However, you should install Watchtower after deploying key applications like FreshRSS to ensure everything is set up correctly before automating updates.
Step 11: Install Watchtower with Ntfy.sh Notifications¶
Run Watchtower with Ntfy.sh
Replace <your-ntfy-topic> with your chosen topic (e.g., freshrss-updates):
docker run -d
--name watchtower
--restart unless-stopped
-v /var/run/docker.sock:/var/run/docker.sock
-e WATCHTOWER_NOTIFICATIONS=ntfy
-e WATCHTOWER_NOTIFICATION_URL="https://ntfy.sh/<your-ntfy-topic>"
containrrr/watchtower
Verify Watchtower is Running
Check logs to confirm Watchtower is monitoring containers and sending notifications:
- Test Ntfy.sh Notifications
Open your Ntfy.sh topic URL (https://ntfy.sh/<your-ntfy-topic>) in a browser or use the mobile app to verify Watchtower messages.