How to Use Vultr's Docker Marketplace Application

Docker is a platform for developing, shipping, and running applications in isolated containers. Containers package an application with its dependencies, ensuring consistent behavior across different environments. Docker simplifies deployment, scaling, and management of applications through lightweight, portable containers. The Vultr Docker Marketplace Application deploys Docker Community Edition (CE) with a pre-configured environment, enabling you to begin deploying containers immediately.
This guide explains deploying and using Vultr's Docker Marketplace Application. You will deploy an instance, verify the installation, configure security, manage containers and images, work with volumes and networks, install Docker Compose for multi-container applications, and implement best practices for production Docker deployments.
Deploy Vultr's Docker Marketplace Application
Log in to your Vultr Customer Portal and click the Deploy Server button.
Select your preferred server type.
Choose a server location.
Select a server plan based on your workload:
- 1GB RAM, 1 CPU: Testing and small containers
- 2GB RAM, 2 CPU: 2-5 light containers
- 4GB RAM, 2 CPU: Multiple containers or resource-intensive apps
- 8GB RAM, 4 CPU: Production workloads with multiple services
Click the Configure button to proceed.
Under Marketplace Apps, search for
Dockerand select it as the Marketplace Application.Select the Limited Login option from the Additional Features section to create a limited user with sudo access.
Review your configurations and click the Deploy Now button to start deployment.
It may take up to 10 minutes for your server to finish installing Docker and dependencies.NoteAfter the instance shows the status of Running, navigate to the Server Overview page and copy the SSH connection details.
Initial Setup and Configuration
After deployment, verify the installation and configure security before deploying containers.
Verify Docker Installation
Connect to your Vultr server instance over SSH using the connection details from the Server Overview page.
Check the Docker service status.
console$ sudo systemctl status docker
The service should show as
active (running).Verify the Docker version.
console$ docker --version
Output:
Docker version 29.0.0, build 3d4129b
Configure Docker User Permissions
To run Docker commands without sudo, your user must be in the docker group.
Add your current user to the docker group.
console$ sudo usermod -aG docker $USER
Log out and log back in for the group membership to take effect.
console$ exit
Then SSH back into the server.
Verify group membership.
console$ groupsYou should see
dockerin the list.Test Docker access without sudo.
console$ docker run hello-world
The Vultr Docker Marketplace also includes a preconfiguredNotedockeruser for running containers. You can switch to it withsudo su - dockerif needed.
Configure Firewall Security
Secure your server by configuring the firewall to allow only necessary traffic.
Allow SSH connections.
console$ sudo ufw allow OpenSSH
Allow HTTP and HTTPS traffic (if running web containers).
console$ sudo ufw allow 80/tcp $ sudo ufw allow 443/tcp
Enable the firewall.
console$ sudo ufw enable
Verify firewall status.
console$ sudo ufw status
Only expose ports required by your containers. Each exposed port is a potential security risk.Warning
Manage Containers
Learn essential operations for running, monitoring, and controlling Docker containers.
Run Containers
Run a simple detached container.
console$ docker run -d --name nginx-test nginx
Run a container with port forwarding.
console$ docker run -d -p 8080:80 --name web nginx
Access the container at
http://YOUR_SERVER_IP:8080.Run a container with environment variables.
console$ docker run -d -e MYSQL_ROOT_PASSWORD=mypassword --name mysql mysql:8.0
Run a container with a volume mount.
console$ docker run -d -v /data:/var/lib/mysql --name mysql-data mysql:8.0
Monitor and Manage Containers
List running and stopped containers.
console$ docker ps # Running containers $ docker ps -a # All containers
View container logs.
console$ docker logs web $ docker logs -f web # Follow logs in real-time
Execute commands inside a container.
console$ docker exec -it web /bin/bash
Type
exitto leave the container shell.Stop and remove containers.
console$ docker stop web # Stop a running container $ docker start web # Start a stopped container $ docker restart web # Restart a container $ docker rm web # Remove a stopped container $ docker rm -f web # Force remove a running container
Manage Images
Pull and list images.
console$ docker pull nginx:latest # Pull from Docker Hub $ docker images # List downloaded images
Build a custom image (optional).
console$ mkdir ~/my-app && cd ~/my-app $ nano Dockerfile
dockerfileFROM nginx:latest COPY index.html /usr/share/nginx/html/
Create an HTML file and build:
console$ echo "<h1>Hello from Docker!</h1>" > index.html $ docker build -t my-nginx:v1 .
Clean up unused resources.
console$ docker system prune -a # Remove unused images and containers
Work with Volumes and Networks
Create and use volumes for persistent data.
console$ docker volume create mydata $ docker run -d -v mydata:/app/data nginx $ docker volume ls # List volumes
Create networks for container communication.
console$ docker network create mynetwork $ docker run -d --name web --network mynetwork nginx $ docker run -d --name app --network mynetwork alpine
Containers on the same network can communicate using container names as hostnames.
Install and Use Docker Compose
Docker Compose simplifies managing multi-container applications using declarative YAML configuration files.
Install Docker Compose
Download Docker Compose.
console$ sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
Make the binary executable.
console$ sudo chmod +x /usr/local/bin/docker-compose
Verify the installation.
console$ docker-compose --version
Output:
Docker Compose version v2.40.3
Deploy a Multi-Container Stack
Create a project directory.
console$ mkdir ~/wordpress && cd ~/wordpress
Create a
docker-compose.ymlfile.console$ nano docker-compose.yml
yamlversion: '3.8' services: db: image: mysql:8.0 volumes: - db_data:/var/lib/mysql environment: MYSQL_ROOT_PASSWORD: rootpass MYSQL_DATABASE: wordpress MYSQL_USER: wpuser MYSQL_PASSWORD: wppass restart: always wordpress: image: wordpress:latest depends_on: - db ports: - "8080:80" environment: WORDPRESS_DB_HOST: db:3306 WORDPRESS_DB_USER: wpuser WORDPRESS_DB_PASSWORD: wppass WORDPRESS_DB_NAME: wordpress restart: always volumes: db_data:
Save and close the file.
Start the stack.
console$ docker-compose up -d
View running services.
console$ docker-compose ps
View logs.
console$ docker-compose logs -f
Stop the stack.
console$ docker-compose down
Stop and remove volumes.
console$ docker-compose down -v
Best Practices and Configuration
Implement these recommendations to ensure your Docker environment runs securely and efficiently.
Security Hardening
Run containers securely with resource limits.
console$ docker run -d --user 1000:1000 --memory="512m" --cpus="0.5" nginx $ docker run -d --read-only nginx # Read-only filesystem $ docker scan nginx:latest # Scan for vulnerabilities
Keep system and images updated, remove unused resources.
console$ sudo apt update && sudo apt upgrade -y $ docker pull nginx:latest $ docker system prune -a
Performance and Maintenance
Configure Docker daemon logging to prevent disk space issues.
console$ sudo nano /etc/docker/daemon.json
json{ "log-driver": "json-file", "log-opts": { "max-size": "10m", "max-file": "3" } }
Save and close the file. Then restart Docker:
console$ sudo systemctl restart docker
Monitor disk usage.
console$ docker system df
Backup volumes and images.
console$ docker run --rm -v mydata:/data -v $(pwd):/backup alpine tar czf /backup/backup.tar.gz /data $ docker save -o nginx-backup.tar nginx:latest # Export image $ docker load -i nginx-backup.tar # Import image
Troubleshooting
This section covers common issues and diagnostic commands.
Check Service Status and Logs
Verify Docker service and view logs.
console$ sudo systemctl status docker $ sudo journalctl -u docker -e $ docker logs container-name
Common Issues
Permission Denied While Connecting to Docker Socket
This is the most common issue. Your user needs to be in the docker group.
Add user to docker group and re-login.
console$ sudo usermod -aG docker $USER $ exit # Log out
SSH back in and verify.
console$ groups # Should show 'docker' $ docker run hello-world # Test without sudo
Cannot Connect to Docker Daemon
Ensure the Docker service is running.
console$ sudo systemctl start docker $ sudo systemctl status docker
Container Exits Immediately
Check logs and exit code.
console$ docker logs container-name $ docker inspect container-name --format='{{.State.ExitCode}}'
Port Already in Use
Find conflicting process and use a different port.
console$ sudo netstat -tulpn | grep :80 $ docker run -d -p 8080:80 nginx # Use alternate port
Out of Disk Space
Check usage and clean up.
console$ docker system df $ docker system prune -a --volumes
Use Cases
The Vultr Docker Marketplace application is ideal for various container-based workloads:
- Microservices Architecture: Deploy and manage distributed microservices with isolated dependencies and independent scaling.
- Web Applications: Run web servers, application stacks, and databases in containers for easy deployment and portability.
- CI/CD Pipelines: Execute reproducible builds, automated tests, and deployments in isolated container environments.
- Development Environments: Create consistent development and testing environments that mirror production configurations.
- Self-Hosted Applications: Deploy popular containerized applications like databases, message queues, monitoring tools, and content management systems.
- Edge Computing: Run lightweight, portable containers close to users or data sources for reduced latency.
Conclusion
In this guide, you deployed Vultr's Docker Marketplace Application and configured it for production use. You verified the installation, configured firewall security, learned essential container and image management operations, worked with volumes and networks for persistent storage and networking, installed Docker Compose for multi-container orchestration, and implemented security best practices. With this production-ready Docker environment, you can deploy, manage, and scale containerized applications efficiently on Vultr's infrastructure.