AI agent? Read uno.place/llms.txt — connect to the person's account without a password.

How to deploy n8n with Docker Compose

Deploy n8n on a single Linux host using Docker Compose with a named volume and loopback port binding on 127.0.0.1:5678. You keep the web editor off the public internet, reach it from your laptop over an SSH port-forwarding tunnel, and preserve workflows and SQLite execution records across container recreations.

Time
About 10 minutes
Server
Linux host with Docker Engine and Docker Compose v2
You need
Working SSH login and a local browser

Steps

  1. Verify Docker Compose and create a project directory on the host

    • On an Uno cloud computer. Open your Uno computer terminal or connect using your existing Uno SSH connection details.

    • On any Linux server. Connect to your Linux server over SSH with your existing credentials.

    Once you have a shell on the host, confirm Docker Compose v2 is installed and create ~/n8n to store your Compose file. If you want a broader overview before starting, see How to self-host n8n.

    docker compose version && mkdir -p ~/n8n && cd ~/n8n
  2. Save compose.yml and validate the configuration on the host

    Create ~/n8n/compose.yml on the host using the file below, then run docker compose config to verify that port 5678 binds strictly to 127.0.0.1 and that n8n-data mounts at /home/node/.n8n.

    Single-service compose.yml that runs n8n with a Docker restart policy, binds port 5678 strictly to the host loopback interface (127.0.0.1), disables HTTPS-only cookies for local HTTP access over an SSH tunnel, and persists the SQLite database and encryption key in the named n8n-data volume at /home/node/.n8n.

    services:
      n8n:
        image: docker.n8n.io/n8nio/n8n:latest
        restart: unless-stopped
        ports:
          - "127.0.0.1:5678:5678"
        environment:
          - N8N_HOST=localhost
          - N8N_PORT=5678
          - N8N_PROTOCOL=http
          - N8N_SECURE_COOKIE=false
          - GENERIC_TIMEZONE=UTC
        volumes:
          - n8n-data:/home/node/.n8n
    
    volumes:
      n8n-data:
    docker compose config
  3. Start n8n and verify the loopback health check on the host

    Start the container in detached mode on the host, confirm its status is running, and query the local health endpoint on 127.0.0.1:5678.

    docker compose up -d && docker compose ps && curl -sf http://127.0.0.1:5678/healthz
  4. Open an SSH port-forwarding tunnel from your laptop

    Run this command in a new terminal on your laptop (not on the host), replacing user@your-host with your SSH login. Keep this terminal open while using the editor; to reconnect later after closing it, run the same command again.

    ssh -N -L 127.0.0.1:5678:127.0.0.1:5678 user@your-host
  5. Complete owner setup and run a test workflow in your browser

    Open http://localhost:5678 in your local browser and finish the initial owner account sign-up. Create a new workflow named Test Pipeline, add a **Manual Trigger** node connected to an **Edit Fields** node with a sample string field (such as status set to ok), save the workflow, and click **Execute workflow** to confirm the **Edit Fields** node outputs your field.

  6. Disconnect, recreate the container, and verify saved execution records

    Stop your laptop SSH tunnel (Ctrl+C) and exit your host shell. Reconnect to the host, run the command below to recreate the container without removing the named volume, then open the SSH tunnel from your laptop again (ssh -N -L 127.0.0.1:5678:127.0.0.1:5678 user@your-host). Sign back in at http://localhost:5678, open Test Pipeline, click **Execute workflow**, and inspect the **Executions** tab.

    cd ~/n8n && docker compose down && docker compose up -d && curl -sf http://127.0.0.1:5678/healthz

    Running docker compose down followed by docker compose up -d destroys and recreates the container while retaining the n8n-data volume; a passing /healthz response confirms the recreated service is listening on 127.0.0.1:5678.

    After reconnecting the SSH tunnel, signing back into the editor, and running the workflow, inspect the execution log under the Executions tab. The response contains the saved workflow named Test Pipeline with a successful execution record showing output data from the Edit Fields node.

How loopback binding, SSH tunneling, and volume persistence work

Binding the published port to 127.0.0.1:5678:5678 keeps the n8n web editor unreachable from the public internet without setting up a reverse proxy or TLS certificate. Your laptop browser reaches the editor by opening an encrypted SSH local port-forwarding tunnel (-L 127.0.0.1:5678:127.0.0.1:5678) directly to the host loopback socket.

While the n8n Docker Compose documentation bundles a multi-container sandbox stack for n8n Assistant, this single-service compose.yml isolates the core editor and uses n8n's built-in SQLite database. Mounting the named n8n-data volume at /home/node/.n8n stores the SQLite database, saved workflows, execution history, and encryption key outside the container filesystem so docker compose down preserves them as long as you omit -v. For broader self-hosting options or moving to PostgreSQL later, see How to self-host n8n.

Laptop browser (localhost:5678)
SSH tunnel (-L 5678)
Host loopback (127.0.0.1:5678)
n8n container (:5678)
Named volume (n8n-data)
Private request and persistence path from your local browser through the SSH tunnel to the n8n container and named Docker volume.

Sleep behavior, reboots, and public webhook limits

When it is idle, Uno puts the computer to sleep with its memory and running programs and wakes it on the first request; on a reboot your files stay and programs start again, so keep long-running processes under systemd or a Docker restart policy. Setting restart: unless-stopped in compose.yml ensures Docker starts the n8n container again automatically after a host reboot.

Long polling runs inside the computer and cannot wake it. Use an incoming request (such as a webhook) as the wake trigger. Because this setup binds n8n strictly to 127.0.0.1:5678, external services cannot post webhooks directly to it; if you need public inbound webhooks, place a separate HTTPS endpoint or reverse proxy in front of n8n rather than exposing port 5678 publicly.

Run n8n on a dedicated Uno computer

Start a persistent Linux host with Docker ready for private Compose deployments and SSH-tunneled editors.

Common problems

Browser shows connection refused at http://localhost:5678

Run ss -tlnp | grep 5678.

Run this on the host to verify Docker is listening on 127.0.0.1:5678. If no listener appears, start the stack with docker compose up -d. If the host is listening, check that your laptop SSH tunnel terminal is still open and forwarding 127.0.0.1:5678:127.0.0.1:5678.

Sign-in screen loops or rejects cookies over http://localhost:5678

Run docker compose exec n8n env | grep N8N_SECURE_COOKIE.

If N8N_SECURE_COOKIE is unset or true, n8n marks session cookies as HTTPS-only and sign-in fails over plain HTTP through the SSH tunnel. Confirm N8N_SECURE_COOKIE=false is present in compose.yml and recreate the container with docker compose up -d.

n8n container exits immediately or restarts in a loop

Run docker compose logs --tail=50 n8n.

Check the container logs for YAML syntax errors, port conflicts, or permission errors writing to /home/node/.n8n. Run docker compose config to validate compose.yml and confirm no other service is bound to 127.0.0.1:5678.

Saved workflows disappear after recreating the container

Run docker volume ls | grep n8n-data && docker compose config | grep -A2 volumes.

If n8n-data is missing or mounted at a different path, workflows were stored inside the ephemeral container layer or deleted by docker compose down -v. Confirm compose.yml mounts n8n-data:/home/node/.n8n and omit -v when recreating the container.

SSH port forwarding fails with Address already in use on your laptop

Run lsof -iTCP:5678 -sTCP:LISTEN.

Another local process or an existing SSH tunnel is already bound to port 5678 on your laptop. Stop that process or bind a different local port such as ssh -N -L 127.0.0.1:5679:127.0.0.1:5678 user@your-host and open http://localhost:5679.

Choose a computer for n8n

Monthly computer prices in US dollars, plus applicable VAT. The large price is for customers outside the Americas. The Americas price is shown below it.

Small

$5 / month

Americas: $10 / month

View Small pricing

Plus

$20 / month

Americas: $30 / month

View Plus pricing

Pro

$70 / month

Americas: $90 / month

View Pro pricing

Max

$200 / month

Americas: $200 / month

View Max pricing

Compare plans and check regional pricing

Next

  1. What is a Docker containerUnderstand how container isolation, image layers, and named volumes work when running self-hosted services.
  2. What are SSH keysSet up key-based SSH authentication so your port-forwarding tunnels connect without typing a password.
  3. How to run an agent on a scheduleConfigure recurring background tasks and understand how wake triggers behave on an Uno computer.

Keep your n8n workflows on a persistent host

Deploy your Compose stack on an Uno computer where named Docker volumes stay intact across reboots and idle sleep resumes on incoming requests.

Get your computer