N8n is experiencing a moment of growth right now as AI-driven automations become more prevalent. In this tutorial, you'll learn how to deploy n8n on Ubuntu 25.10 and set up your first automation.

What is n8n?

If you clicked on this tutorial, you are likely already familiar with n8n. However, if you aren't, n8n is a workflow automation platform that you can use to create unique automations using different sources as inputs.

As an example, you could create an n8n workflow to automatically monitor your GitHub repository for new issues, extract key information using AI, and then post a formatted summary to your team's Slack channel. This entire process would run automatically whenever a new issue is created.

Other popular workflows include:

  • Content automation: Automatically posting blog updates from your CMS to multiple social media platforms
  • Data processing: Pulling data from APIs, transforming it, and storing it in your database
  • Customer support: Creating tickets in your helpdesk system when customers email specific addresses
  • Marketing automation: Triggering email sequences based on user behaviour on your website

Prerequisites

This tutorial assumes some working knowledge of Linux. Additionally, you will need the following installed:

Getting set up

Create a virtual machine (optional)

If you have an existing Ubuntu virtual machine, feel free to skip this step. The important bit is that you have SSH access to the virtual machine and you have at least 320 MB of memory and 4GB of disk space, as suggested per the documentation.

Head over to your terminal and run the following command to create a new virtual machine:

civo instance create n8n -t ubuntu-jammy --size g3.medium --wait

This will launch a medium Ubuntu instance within an account. Next, obtain the credentials for your new machine:

Show public IP:

civo instance show n8n -o json  | jq .public_ip 

Show password:

civo instance show n8n -o json  | jq .initial_password

Export server IP:

export INSTANCE_IP=$(civo instance show n8n -o json  | jq .public_ip | tr -d '"')

Log in to your instance:

ssh civo@$INSTANCE_IP

Update server packages

Once logged in, ensure all your packages are up to date by running an apt update:

sudo apt update --upgrade -y

Prepare a firewall

Before proceeding with the rest of the installation, it is good practice to lock down your instance so that only the required ports are open.

UFW is a tool that simplifies firewall management. On Ubuntu 25.10, it comes in by default; however, if you don’t have it installed, run the following:

Install UFW:

sudo apt install ufw -y

Open ports 22,80, and 443:

 sudo ufw allow 22 && sudo ufw allow 80 && sudo ufw allow 443

The output is similar to:

Rules updated
Rules updated (v6)
Rules updated
Rules updated (v6)
Rules updated
Rules updated (v6)

Finally, enable the firewall:

sudo ufw enable

Install Docker

The fastest way to get n8n running is by using containers; as such, you will need to install Docker.

Install dependencies and the GPG key for Docker:

# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

# Add the repository to Apt sources:
echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
  $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update

Install Docker packages:

sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y 

Set up a non-root Docker user

Create a Docker group:

sudo groupadd docker

Add your user to the Docker group:

sudo usermod -aG docker $USER

Activate the changes

newgrp docker

Configure a reverse proxy

To avoid exposing an IP address and a port to the internet. It is always good to use a reverse proxy to provide TLS as well as a simpler address for accessing your services. In this tutorial, we will be using Caddy.

Install Caddy:

sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https curl

curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' \
| sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg

curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' \
| sudo tee /etc/apt/sources.list.d/caddy-stable.list

sudo apt update
sudo apt install caddy -y

Set a domain name

Before you set up the reverse proxy, you will need a domain name. If you have purchased one from a registrar. Follow the second step in this section.

Existing domain name

sudo tee /etc/caddy/Caddyfile > /dev/null <<EOF
yourdomain.io {
    reverse_proxy localhost:5678
}
EOF

Without a domain name

A trick if you don’t have a domain name is to use nip.io, so instead of editing a host file, you can use the following configuration instead:

sudo tee /etc/caddy/Caddyfile > /dev/null <<EOF
yourserverip.nip.io {
    reverse_proxy localhost:5678
}
EOF
⚠️ Note: Be sure to replace <yourserverip> with your virtual machines ip address

Restart caddy

In order for the changes to take effect, restart Caddy:

sudo systemctl restart caddy

Create a Docker Compose file

To manage the container for running n8n, Docker Compose is a great choice, as you do not need to manually map volumes each time you do an upgrade or restart.

tee docker-compose.yml < /dev/null >>EOF
services:
  n8n:
    image: docker.io/n8nio/n8n:latest
    restart: always
    ports:
      - "5678:5678"
    volumes:
      - n8n_data:/home/node/.n8n

volumes:
  n8n_data:
EOF

Start n8n

Start the container:

docker compose up -d

In a couple of moments, you should be able to access your n8n instance at https://<yourinstanceip>nip.io, which should look something like this the first time you access it:

Self-Hosting n8n on Ubuntu 25.10

Once you create an account, the next page should look like this:

Self-Hosting n8n on Ubuntu 25.10

Clean up

Upon completing this tutorial, if you would like to clean up the resource you just provisioned, you only need to delete the VM. You can do this by running:

civo instance rm n8n

Closing thoughts

N8n is a powerful automation platform, and while this tutorial focused on deploying n8n, there are many types of integrations to choose from. Additionally, if you are looking to learn more about AI or machine learning, here are some good ideas: