Difficulty Level: 🟢 Beginner
Estimated Time: 15-20 minutes
Congratulations! Your n8n self-hosted server is ready. This guide will walk you through your first connection and help you verify everything is working correctly.
Before starting, make sure you have:
id_client_USERNAME or similar)💡 TIP: Keep your credentials PDF and SSH key in a secure location. Consider using a password manager.
Here's what we'll do in this guide:
Let's make sure all your web services are accessible before diving into the command line.
https://n8n.yourdomain.website You can find this URL in the PDF : SERVICE N8N > n8n URLExpected Result:
⚠️ If you see a security warning: This is not normal, and you should contact me for further investigation.
Login to n8n:
https://phpmyadmin.yourdomain.website You can find this URL in the PDF : SERVICE PHPMYADMIN > PhpMyAdmin URLExpected Result:
⚠️ CAUTION: phpMyAdmin provides direct database access. Be very careful when making changes here.
https://traefik.yourdomain.website You can find this URL in the PDF : SERVICE TRAEFIK > Traefik URLExpected Result:
https://pgadmin.yourdomain.website You can find this URL in the PDF : SERVICE PGADMIN > Pgadmin URLExpected Result:
Now let's connect to your server via SSH. If you haven't set up SSH yet, please refer to 02 - SSH Connection Guide first.
Using Terminal (Mac/Linux) or PowerShell (Windows):
# Navigate to where your SSH key is stored
cd ~/path/to/your/ssh/key
# Set correct permissions (Mac/Linux only)
chmod 600 id_client_USERNAME
# Connect to your server
ssh -i filepath/to/your/private/key -p 1077 USERNAME@YOUR_SERVER_IP
💡 TIP: Your username and server IP can be found in the section SERVER INFORMATION in the credentials PDF.
Expected Result:
Welcome to Ubuntu 24.04.3 LTS (GNU/Linux 6.8.0-90-generic x86_64)
[...]
💡 TIP: If this is your first connection, you'll be asked to verify the server fingerprint. Type
yesto continue.
Once connected, let's verify your setup:
# Check your current location
pwd
# Output: /home/USERNAME
# List files in your home directory
ls -la
# You should see a 'docker' folder
# Navigate to the docker folder
cd docker
# See what's inside
ls -la
# You should see: docker-compose.yml, .env file, backup, maintenance, storage
Let's check that all Docker containers are up and healthy.
# Make sure you're in the docker directory
cd /home/USERNAME/docker
# View running containers
docker compose ps
Expected Output:
NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS
mysql mysql:8.4 "docker-entrypoint.s…" mysql 11 hours ago Up About an hour 3306/tcp, 33060/tcp
n8n docker.n8n.io/n8nio/n8n "tini -- /docker-ent…" n8n 11 hours ago Up About an hour 127.0.0.1:5678->5678/tcp
pgadmin dpage/pgadmin4:9 "/entrypoint.sh" pgadmin 11 hours ago Up About an hour 80/tcp, 443/tcp
phpmyadmin phpmyadmin:5.2 "/docker-entrypoint.…" phpmyadmin 11 hours ago Up About an hour 80/tcp
postgres postgres:17 "docker-entrypoint.s…" postgres 11 hours ago Up About an hour 5432/tcp
traefik traefik "/entrypoint.sh --ap…" traefik 11 hours ago Up About an hour 0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp
✅ All containers should show "Up" - If any show "Restarting" or "Exited", see 11 - Troubleshooting Guide
# Check Docker logs for errors (last 20 lines of each service)
docker compose logs --tail=20 n8n
docker compose logs --tail=20 mysql
docker compose logs --tail=20 traefik
docker compose logs --tail=20 pgadmin
docker compose logs --tail=20 postgres
# Check disk space
df -h
# Make sure you have at least 20% free space on your main partition (/dev/vda1)
Expected Output
Filesystem Size Used Avail Use% Mounted on
tmpfs 197M 1.1M 196M 1% /run
/dev/vda1 19G 6.3G 12G 35% / <= Should be less than 80%
tmpfs 984M 0 984M 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 197M 8.0K 197M 1% /run/user/1000
What to look for in logs:
Here's how your server is organized:
/home/USERNAME/
└── docker/ # Main Docker setup folder
├── maintenance # All the scripts in this documentation can be found in this directory.
├── backups # This folder will be created if you execute the backup.sh script.
├── docker-compose.yml # Defines all the docker servicess
├── .env # Environment variables & secrets
└── storage # Mounting points to override configuration files
Important Files:
docker-compose.yml - Defines what containers run and how.env - Contains passwords, domain names, and configurationWhere is your data stored?
Your actual data (n8n workflows, database, etc.) is stored in Docker named volumes, not in regular folders. These are managed by Docker itself.
# View all Docker volumes
docker volume ls
# You should see volumes like:
DRIVER VOLUME NAME
local docker_mysql_data
local docker_n8n_data
local docker_n8n_files
local docker_traefik_letsencrypt
local docker_pgadmin_data
local docker_postgres_data
To inspect a volume's location:
# See where Docker stores a specific volume
docker volume inspect docker_n8n_data
# This will show something like:
"Mountpoint": "/var/lib/docker/volumes/docker_n8n_data/_data"
⚠️ IMPORTANT: Do NOT manually edit files in
/var/lib/docker/volumes/- always use Docker commands to manage volumes.
💾 BACKUP NOTE: To backup your data, you'll need to backup the Docker volumes, not regular folders. See 06 - Backup & Recovery for the proper procedure.
Quick volume commands you'll need:
# List all volumes
docker volume ls
# See volume details (including size and location)
docker volume inspect VOLUME_NAME
# DANGEROUS: Remove unused volumes (will ask for confirmation)
docker volume prune
# PostgreSQL (uncomment these 6 lines if switching to PostgreSQL)
# DB_TYPE: postgresdb
# DB_POSTGRESDB_HOST: postgres
# DB_POSTGRESDB_PORT: 5432
# DB_POSTGRESDB_DATABASE: ${POSTGRES_DB}
# DB_POSTGRESDB_USER: ${POSTGRES_USER}
# DB_POSTGRESDB_PASSWORD: ${POSTGRES_PASSWORD}
-> And comment the SQLITE parameter adding a # at the begining of the line.
DB_SQLITE_POOL_SIZE: 3
Now that you're connected, let's complete some important security tasks.
It's good practice to change the passwords from the defaults provided if and only if you are not in fully managed mode. Otherwise, you're literally shutting me off your server administration:
Change n8n Admin Password:
Change MySQL Root Password (Optional but recommended):
# Connect to MySQL container
docker compose exec mysql mysql -u root -p
# Enter current root password from the PDF file
# Change password
ALTER USER 'root'@'localhost' IDENTIFIED BY 'your-new-strong-password';
ALTER USER 'root'@'%' IDENTIFIED BY 'your-new-strong-password';
FLUSH PRIVILEGES;
EXIT;
# Connect to PostgreSQL container
docker compose exec postgres psql -U postgres
# Change password
ALTER USER n8n_user WITH PASSWORD 'your-new-strong-password';
\q
# Update the .env file with new password
nano .env
# Find MYSQL_ROOT_PWD and update it
# Find POSTGRES_PASSWORD and update it
# Press CTRL+X, then Y, then ENTER to save
# Restart containers to apply new password
cd ~/docker
docker compose down
docker compose up -d
# Verify n8n can connect (if n8n is configured as using Postgres as a DBengine).
docker compose logs n8n | grep -i "database\|postgres"
Let's see who has access to your server:
# View authorized SSH keys (in USERNAME account)
cat ~/.ssh/authorized_keys
# View authorized SSH keys (in root account)
sudo cat /root/.ssh/authorized_keys
You should see:
💡 TIP: If you want to remove my access immediately, see 03 - Security & Access Management
Fail2ban is protecting your server from brute force attacks:
# Check if fail2ban is running
sudo systemctl status fail2ban
Expected Output:
● fail2ban.service - Fail2Ban Service
Loaded: loaded (/usr/lib/systemd/system/fail2ban.service; enabled; preset: enabled)
Active: active (running) since Tue 2025-12-23 05:12:39 CET; 5 days ago
# View current jails (protection rules)
sudo fail2ban-client status
Expected Output:
Status
|- Number of jail: 3
`- Jail list: port-scan, ssh-username-scan, sshd
✅ All jails should be active. If you ever lock yourself out, see 03 - Security & Access Management
Let's make sure you can perform basic management tasks.
# Navigate to docker folder
cd /home/USERNAME/docker
# Restart n8n (safe operation)
docker compose restart n8n
# Check it came back up
docker compose ps
Expected: n8n should restart in 5-10 seconds and show in the STATUS column "Up"
# View n8n logs in real-time
docker compose logs -f n8n
# Press CTRL+C or ⌘+C to stop viewing (this does NOT stop the container)
💡 TIP: The
-fflag means "follow" - you'll see new log entries as they happen
Before moving on, make sure you can check all these boxes:
Congratulations! Your server is verified and ready to use. Here's what to learn next:
Daily Operations:
Important Maintenance:
When Things Go Wrong:
Quick Reference:
If something isn't working:
Common First-Time Issues:
df -hHere are the most common commands you'll use:
# Navigate to docker folder
cd /home/USERNAME/docker
# View container status
docker compose ps
# View logs
docker compose logs -f n8n
# Stop all services
docker compose down
# Start all services in detached mode
docker compose up -d
# Restart all services
docker compose restart
# Restart specific service
docker compose restart n8n
# Check disk space
df -h
# Exit SSH session
exit
Next Guide: 02 - SSH Connection Guide
Back to: Documentation Home