/

/

Getting Started With Docker on a Cloud VM: Step-by-Step Guide

Developers

Why Docker on a Cloud VM?

Docker makes it easy to package, ship, and run applications in lightweight containers. Pairing Docker with a Cloud VM gives you the flexibility of your own server environment and the speed to deploy applications consistently across projects.

Whether you’re testing locally, hosting side projects, or running production workloads, Docker on a Cloud VM combines control, scalability, and affordability.

Step 1: Create a Docker-Ready VM

  1. Log in to your Raff dashboard.

  2. Go to Create VM → Marketplace.

  3. Select Docker 28.1 on Ubuntu 24.04 from the available templates.

  4. Choose your plan (start small — 2 CPU, 4GB RAM is enough for most demos).

  5. Launch your VM and connect via SSH:

ssh root

Step 2: Verify Docker Installation

Since Raff’s template comes with Docker pre-installed, you don’t need to install it manually. Just confirm the version:

docker --version

You should see Docker’s version number printed on screen.

Step 3: Run Your First Container

Test Docker with the classic hello-world image:

docker run hello-world

If it prints a welcome message, Docker is running correctly.

Step 4: Run a Real Application (Example: Nginx)

Spin up a lightweight web server:

docker run -d -p 80:80 nginx

Now visit your VM’s public IP in your browser — you should see the Nginx welcome page.

Step 5: Manage Docker Without sudo

To avoid typing sudo every time:

sudo usermod -aG docker $USER

Log out and back in for changes to take effect.

Step 6: Keep It Clean

List containers:

docker ps -a

Stop a container:

docker stop <container_id

Remove a container:

docker rm <container_id

Next Steps

From here, you can:

  • Deploy your own apps inside containers.

  • Use Docker Compose to manage multi-container apps.

  • Experiment with databases, dev environments, or CI/CD pipelines.

Closing Thoughts

With Raff’s pre-configured Docker template, you can skip the manual setup and go straight to running containers in minutes.

It’s a simple, powerful setup for developers who want to experiment, learn, or deploy without the overhead of traditional hosting.