Free lesson

Compose and first private login

Compose and first private login — Self-host n8n for internal use. Minimal core-only service; Configuration and readiness differ; Owner setup over a private path. Practical assignment: Practice: Compose and first private login.

Demo edition. The materials are undergoing editorial review.

Topics covered

  • Minimal core-only service
  • Configuration and readiness differ
  • Owner setup over a private path

Minimal core-only service

Save compose.yaml in a new directory and set N8N_IMAGE to a verified reference. Bind only 127.0.0.1:5678 and mount n8n_data at /home/node/.n8n for SQLite and configuration. TZ controls container system time; GENERIC_TIMEZONE controls schedule-oriented workflows. Our Europe/Rome example includes daylight-saving changes. Do not add community nodes, privileged mode or the Docker socket. Additional AI features and sandbox services are unnecessary for the first manual internal workflow and are not configured by this file.

name: n8n-lab
services:
  n8n:
    image: ${N8N_IMAGE:?Set a verified official n8n image reference}
    restart: unless-stopped
    ports:
      - "127.0.0.1:5678:5678"
    environment:
      TZ: Europe/Rome
      GENERIC_TIMEZONE: Europe/Rome
      N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS: "true"
    volumes:
      - n8n_data:/home/node/.n8n
volumes:
  n8n_data:

Configuration and readiness differ

First use config --quiet to validate syntax and substitutions, then start the service separately. On the host inspect /healthz and sanitized logs. A liveness endpoint does not prove every workflow works or every credential decrypts. If startup fails, investigate mounts, directory permissions and migration errors instead of replacing the state with a fresh empty volume. These commands are provided for your own lab; the course does not claim they were executed or that your account was created.

docker compose config --quiet
docker compose up -d n8n
docker compose ps
curl --fail --max-time 5 http://127.0.0.1:5678/healthz
docker compose logs --tail 40 n8n

Owner setup over a private path

Never leave initial owner setup reachable by strangers. For a VPS, tunnel to loopback5678 and open the corresponding localhost on your laptop. If secure-cookie handling rejects HTTP in your browser, configure HTTPS as taught later rather than disabling protection globally for convenience. The owner creates the account personally with a strong password and records completion without recording the password. Private acceptance includes confirming an anonymous visitor cannot open the editor with owner privileges.

ssh -N -L 15678:127.0.0.1:5678 operator@lab.example
# Open the local forwarded address only after confirming the tunnel.

Practical assignment

Practice: Compose and first private login

Continue to learning

Course outline

  1. Internal installation and scope
  2. Compose and first private login
  3. Encryption key and credentials
  4. HTTPS, editor and webhooks
  5. Full backup and restore
  6. Upgrade and internal-service acceptance