Installing Docker on a one.com VPS
Docker is a reliable way to run applications in isolated containers, and setting it up on a One.com VPS is straightforward once you know the steps. This guide shows you how to install Docker on Ubuntu in this environment, so you can get started quickly and with confidence.
- Requirements
- Step 1 - Update your package index
- Step 2 - Uninstall old versions (if any)
- Step 3 - Install required packages
- Step 4 - Add Docker’s official GPG key
- Step 5 - Set up the Docker repository
- Step 6 - Install Docker Engine
- Step 7 - Verify installation
- What's next?
Note: one.com does not provide support for Docker installations or related issues. If you choose to install Docker on your VPS, you are responsible for setup, configuration, and maintenance.
Requirements
- A one.com VPS installed
- SSH access to the VPS
- A non-root user with
sudoprivileges
Step 1 - Update your package index
Log in to your VPS via SSH.
Run:
sudo apt-get update
Step 2 - Uninstall old versions (if any)
If there are remnants of previous Docker installs, remove them:
sudo apt-get remove docker docker-engine docker.io containerd runc
Step 3 - Install required packages
These packages allow apt to use repositories over HTTPS:
sudo apt-get install \
ca-certificates \
curl \
gnupg \
lsb-releaseStep 4 - Add Docker’s official GPG key
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpgStep 5 - Set up the Docker repository
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/nullStep 6 - Install Docker Engine
Update apt again and install Docker:
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin
Step 7 - Verify installation
Check that Docker is working:
sudo docker run hello-worldIf you see a confirmation message, Docker is ready on your VPS.
When done, it should look like this in your SSH terminal:
What's next?
Docker is now installed on your one.com VPS. So what’s next?
Head to Docker Hub to browse official images, or follow the instructions to pull the images you need and start building your project.
Related articles: