← All tutorials

AI Automation

Run your own n8n automation server with Docker

Install n8n, the workflow tool behind most of these automations, on your own server in a few minutes.

Beginner8 min read5 steps

  1. DockerInstall it
  2. ComposeDescribe n8n
  3. StartBring it up
  4. Sign inOpen the editor

What you need

  • A Linux server or virtual machine with 2 GB of RAM or more
  • A user account with sudo access
  1. Install Docker

    Docker runs n8n in its own container, which keeps it separate from the rest of the server and makes upgrades simple.

    curl -fsSL https://get.docker.com | sudo sh
    sudo docker --version
  2. Describe the n8n service

    Create a folder and a file named docker-compose.yml inside it. The named volume keeps your workflows when the container is replaced.

    services:
      n8n:
        image: docker.n8n.io/n8nio/n8n
        restart: unless-stopped
        ports:
          - "5678:5678"
        environment:
          - GENERIC_TIMEZONE=Asia/Dhaka
          - TZ=Asia/Dhaka
          - N8N_SECURE_COOKIE=false
        volumes:
          - n8n_data:/home/node/.n8n
    
    volumes:
      n8n_data:

    N8N_SECURE_COOKIE=false allows plain HTTP sign-in, so use it only for testing on your own network. Before anyone uses it from the internet, put n8n behind HTTPS and remove that line.

  3. Start n8n

    Run this from the folder that holds the file, then check that the container stays up.

    sudo docker compose up -d
    sudo docker compose ps
  4. Open the editor and create the owner account

    Browse to http://SERVER_IP:5678 and create the owner account with a strong password. If the page does not open, allow port 5678 through the server's firewall for your office network only.

    sudo ufw allow from 192.168.10.0/24 to any port 5678
  5. Know how to update and back up

    Updating pulls the new image and recreates the container, and your data stays in the volume. Back up the volume before major upgrades, because it holds your workflows and encrypted credentials.

    sudo docker compose pull
    sudo docker compose up -d

Want this set up for your business?

We can plan, build and hand it over to your team.

Discuss your setup ↗
Next tutorialBuild your first automation: website form to spreadsheet →