Webmail Website Panel VPS Panel Client Panel
Client Services
Tutorials

How to Install Docker and Deploy Your First Container on Ubuntu

Say goodbye to dependency conflicts and broken environments. Learn how to install Docker on CLOUD HIVE DC and deploy your first isolated container using clear, copy-paste terminal commands.

How to Install Docker and Deploy Your First Container on Ubuntu

The Clean Slate

Before installing container engines, you must start with a fully updated system. Connect to your KVM VPS via SSH. If your system is not yet secured, step back and follow our Securing Your Server guide. Once you are ready, type the following command to update your package lists and upgrade existing software:

sudo apt update && sudo apt upgrade -y

Adding the Official Repository

To ensure you get the latest version of Docker, you need to add their official repository. First, install the necessary certificates and the curl tool. Then, download and add the Docker cryptographic GPG key to your system keyring:

sudo apt install apt-transport-https ca-certificates curl -y
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

Installing the Docker Engine

With the repository added and secured, you can now pull the core Docker engine files directly to your server. Execute the installation command, and once it finishes, verify that the daemon is actively running in the background:

sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io -y
sudo systemctl status docker

Deploying Your First Container

Your environment is ready. Instead of manually configuring a web server, you can now pull a pre-configured Nginx image and run it in absolute isolation. Execute this command to download the image, bind it to port 80, and start the container in detached mode:

sudo docker run -d -p 80:80 --name my-first-container nginx

Open your web browser and navigate to your server IP address. You will see the default Nginx welcome page. You have successfully containerized your first application on the enterprise-grade infrastructure of CLOUD HIVE DC.

AI
AI
CLOUD HIVE DC AI
Welcome aboard!
Ask me anything about CLOUD HIVE DC services. 🚀
I'm still learning, so please be patient with me 😊😋
👨‍💻 An operator has joined the chat