How to Connect to Your VDS Server via SSH (Complete Guide)
Step-by-step SSH connection guide for Linux VDS: PuTTY, Terminal, key-based authentication, Path Panel firewall rules, and security best practices.
Complete Docker guide covering installation, essential commands (run, stop, rm, ps), image management, volumes, and networking basics on Linux servers.
Docker is an open-source platform that lets you run applications in isolated containers. It provides a consistent environment from development to production. This guide covers Docker installation, essential commands, and practical usage scenarios.
Docker packages applications and their dependencies into portable containers. Unlike virtual machines:
Docker is the cornerstone of modern software development and deployment. On REXE servers, you can easily deploy applications using Docker.
# Remove old versions
sudo apt remove docker docker-engine docker.io containerd runc
# Install prerequisites
sudo apt update
sudo apt install ca-certificates curl gnupg lsb-release -y
# Add Docker 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.gpg
# Add 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/null
# Install Docker
sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io docker-compose-plugin -y
# Start and enable service
sudo systemctl start docker
sudo systemctl enable docker
# Add Docker repository
sudo dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
# Install Docker
sudo dnf install docker-ce docker-ce-cli containerd.io docker-compose-plugin -y
# Start service
sudo systemctl start docker
sudo systemctl enable docker
# Check Docker version
docker --version
# Run test container
sudo docker run hello-world
# Use Docker without sudo
sudo usermod -aG docker $USER
newgrp docker
# Run a simple container
docker run nginx
# Run in background (detached)
docker run -d nginx
# Run with port mapping
docker run -d -p 8080:80 nginx
# Run with a name
docker run -d --name web-server -p 8080:80 nginx
# Run with environment variable
docker run -d -e MYSQL_ROOT_PASSWORD=secret --name mysql mysql:8.0
# Run with volume mount
docker run -d -v /host/dir:/container/dir nginx
# Auto-restart policy
docker run -d --restart unless-stopped nginx
# Interactive terminal
docker run -it ubuntu bash
# List running containers
docker ps
# List all containers (including stopped)
docker ps -a
# Stop a container
docker stop container_name
# Start a container
docker start container_name
# Restart a container
docker restart container_name
# Remove a container (must be stopped first)
docker rm container_name
# Force remove running container
docker rm -f container_name
# Remove all stopped containers
docker container prune
# View container logs
docker logs container_name
# Follow logs in real-time
docker logs -f container_name
# Last 100 lines of logs
docker logs --tail 100 container_name
# Container resource usage
docker stats
# Container details
docker inspect container_name
# Attach to container shell
docker exec -it container_name bash
# Run command in container
docker exec container_name ls /var/www
# Pull an image
docker pull nginx
docker pull nginx:1.25
docker pull ubuntu:22.04
# List local images
docker images
# Remove an image
docker rmi nginx
# Remove unused images
docker image prune
# Remove all unused resources
docker system prune -a
# Show image sizes
docker images --format "table {{.Repository}}\t{{.Tag}}\t{{.Size}}"
# Example Dockerfile
FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm install --production
COPY . .
EXPOSE 3000
CMD ["node", "server.js"]
# Build image
docker build -t myapp:1.0 .
# Push to Docker Hub
docker tag myapp:1.0 username/myapp:1.0
docker push username/myapp:1.0
Volumes ensure data persists even when containers are removed.
# Create a volume
docker volume create database-data
# List volumes
docker volume ls
# Mount volume to container
docker run -d -v database-data:/var/lib/mysql mysql:8.0
# Bind mount (host directory)
docker run -d -v /root/data:/app/data nginx
# Remove a volume
docker volume rm database-data
# Remove unused volumes
docker volume prune
# Volume details
docker volume inspect database-data
# List networks
docker network ls
# Create custom network
docker network create app-network
# Connect containers to network
docker run -d --network app-network --name web nginx
docker run -d --network app-network --name db mysql:8.0
# Containers on same network can reach each other by name
# From web container: ping db
# Network details
docker network inspect app-network
# Remove network
docker network rm app-network
docker run -d \
--name nginx-web \
-p 80:80 \
-v /var/www/html:/usr/share/nginx/html:ro \
--restart unless-stopped \
nginx:alpine
docker run -d \
--name mysql-db \
-e MYSQL_ROOT_PASSWORD=strong_password \
-e MYSQL_DATABASE=myapp \
-v mysql-data:/var/lib/mysql \
-p 3306:3306 \
--restart unless-stopped \
mysql:8.0
# Create network
docker network create wordpress-net
# Start MySQL
docker run -d \
--name wordpress-db \
--network wordpress-net \
-e MYSQL_ROOT_PASSWORD=root_pass \
-e MYSQL_DATABASE=wordpress \
-e MYSQL_USER=wp_user \
-e MYSQL_PASSWORD=wp_pass \
-v wp-db-data:/var/lib/mysql \
mysql:8.0
# Start WordPress
docker run -d \
--name wordpress \
--network wordpress-net \
-e WORDPRESS_DB_HOST=wordpress-db \
-e WORDPRESS_DB_USER=wp_user \
-e WORDPRESS_DB_PASSWORD=wp_pass \
-e WORDPRESS_DB_NAME=wordpress \
-p 8080:80 \
wordpress:latest
For managing multiple containers, use Docker Compose. A docker-compose.yml file lets you start all services with a single command.
Docker is an indispensable tool for modern application deployment. Once you master the basics, move on to Docker Compose for multi-service management. On REXE servers, Docker lets you run applications in an isolated, secure, and portable manner.
Virtual machines run a full OS (gigabytes of disk, minutes to start). Docker containers share the host kernel, take megabytes of space, and start in seconds. Containers are lighter and faster but offer less isolation than VMs.
A Docker volume is managed storage under /var/lib/docker/volumes/. A bind mount maps a specific host directory into the container. Volumes are better for portability and backups; bind mounts are useful for sharing code in development.
Data inside the container is lost, but data written to a volume persists. Always use volumes for data that must survive container restarts: 'docker run -v data-volume:/data/path ...'.
Docker Hub is the central registry for official and community images. 'docker pull nginx' downloads the nginx image from Docker Hub. You can also push your own images with 'docker push'. Create a free account at hub.docker.com.
Run the container with '--restart unless-stopped'. This ensures it restarts when the server reboots or the container crashes. To update an existing container: 'docker update --restart unless-stopped container_name'.
Step-by-step SSH connection guide for Linux VDS: PuTTY, Terminal, key-based authentication, Path Panel firewall rules, and security best practices.
Complete guide to connecting to Windows Server VDS via Remote Desktop (RDP): setup steps, NLA security, Path Panel firewall rule, and troubleshooting tips.
Step-by-step guide to changing your VDS server OS via REXE panel: backup tips, supported Linux distributions and Windows Server versions explained.