cloud vps server hosting

Apr 14, 2026

15 min read

How to Install n8n on Ubuntu with Docker and Let’s Encrypt

Written by

Abdelhadi Dyouri
n8n is an open-source workflow automation platform that lets you connect apps, APIs, and services through a visual interface without giving up code-level control. This guide shows you how to install n8n on Ubuntu 24.04 server using Docker and accessing the package's web interface using Nginx as a reverse proxy. Install n8n on Ubuntu with Docker and Let's Encrypt Note: Prefer Caddy over Nginx for automatic HTTPS? See our n8n + Caddy installation guide for an alternative approach.

Prerequisites

Before you begin:
  • Deploy an Ubuntu 24.04 server. SSD Nodes VPS plans start at $5.50/month with a lifetime price lock and 14 global data center locations.
  • Create a non-root user with sudo privileges.

Install n8n on Ubuntu with Docker and Let's Encrypt - Quick Start

If you just want to get n8n running on Ubuntu 24.04 with Docker and Let's Encrypt, here are the essential commands:
$ sudo apt install -y ca-certificates curl gnupg

# Create n8n directory and data volume
$ mkdir n8n && cd n8n
$ mkdir ./n8n_data
$ sudo chown -R 1000:1000 ./n8n_data

# Create and start the n8n container
$ nano docker-compose.yml   # paste your config, then run:
$ docker compose up -d

# Install Nginx and SSL
$ sudo apt install nginx -y
$ sudo apt install certbot python3-certbot-nginx -y
$ sudo certbot --nginx -d example.com
Using Docker Compose and Nginx is a reliable way to run n8n with HTTPS on your own VPS. For full configuration details and step-by-step instructions, continue reading below.

Install n8n Depedencies

Begin by updating your system and installing Docker, a lightweight platform that runs applications in isolated, reproducible environments. Docker ensures secure, portable setups ideal for hosting services like n8n and simplifies deployment by abstracting dependencies and enabling scalable, modular infrastructure. For a full Docker primer, see Getting Started with Docker on a VPS.
  1. SSH to your server using the non-root user, refresh your system's package information index, and ugprade the system's packages.
    $ sudo apt update && sudo apt upgrade -y
  2. Install the following dependency packages. Docker requires these packages to run.
    $ sudo apt install -y ca-certificates curl gnupg
    • ca-certificates: Ensures your system trusts HTTPS sources by installing root certificates—critical for verifying Docker's GPG key and repository.
    • curl: Fetches data from URLs using the command-line interface. You'll use curl to download Docker's GPG key and other setup files.
    • gnupg: Provides encryption and signing tools, including GPG key management. Docker uses gnupg to verify the authenticity of its packages.
  3. Download the Docker GPG key. The key is a cryptographic signature that verifies the authenticity and integrity of Docker's software packages.
    $ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
  4. Set up your system to recognize Docker's official package repository, so you can securely install and update Docker using Ubuntu apt commands.
    $ echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
  5. Refresh your system's package information index to pick up the new changes.
    $ sudo apt update
  6. Install Docker and its core components.
    $ sudo apt install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
    • docker-ce: Docker Community Edition, the core engine that runs containers.
    • docker-ce-cli: Command-line interface for interacting with Docker using commands such as docker ps.
    • containerd.io: Lightweight container runtime that Docker uses internally to manage container lifecycle.
    • docker-compose-plugin: Plugin that adds support for Docker Compose, allowing you to define and run multi-container apps using a docker-compose.yml
Continue reading this article
by subscribing to our newsletter.
Subscribe now

Leave a Reply