Back to blog
tech

Setting Up a VPS with Docker and Portainer

A quick guide on how I set up my Japan VPS with Docker, Portainer, and secure SSH access — from zero to production.

May 16, 2026docker, vps, devops

The Goal

I wanted a lightweight VPS that could host multiple services using Docker containers, managed through a web UI (Portainer), with secure SSH key-only access.

Step 1: Initial Server Setup

After provisioning the VPS, first things first — security:

# Generate Ed25519 key locally
ssh-keygen -t ed25519 -C "my-vps-key"
 
# Copy public key to server
ssh-copy-id -i ~/.ssh/my_key.pub root@server-ip
 
# Disable password authentication
sudo sed -i 's/PasswordAuthentication yes/PasswordAuthentication no/' /etc/ssh/sshd_config
sudo systemctl restart sshd

Step 2: Install Docker

curl -fsSL https://get.docker.com | sh
systemctl enable docker
systemctl start docker

Step 3: Deploy Portainer

docker volume create portainer_data
docker run -d \
  --name portainer \
  --restart=always \
  -p 9443:9443 \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -v portainer_data:/data \
  portainer/portainer-ce:latest

Now access Portainer at https://your-ip:9443 and set up your admin account.

Summary

With this setup, you get:

  • Secure access — SSH key only, no password
  • Container management — Portainer web UI
  • Easy scaling — Add more services as Docker containers

This is the foundation I use for all my self-hosted services. Next up: deploying a blog! 😄

Setting Up a VPS with Docker and Portainer | Pop's Blog