Skip to content

This guide will help you deploy n8n locally using Docker Compose, ensuring your data is persistent and easily manageable.

License

Notifications You must be signed in to change notification settings

mehdimahmoud/n8n-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

n8n local Docker Compose Deployment

This project offers a straightforward and secure method to run n8n with Docker Compose on Ubuntu.
n8n is an open-source workflow automation tool that allows you to connect various applications and services to automate tasks without writing code.
This guide will help you deploy n8n locally using Docker Compose, ensuring your data is persistent and easily manageable.

Table of Contents

Prerequisites

  • Docker installed
  • Docker Compose installed
  • An existing Docker volume for persistent data (see below)

Deployment Steps

  1. Clone this repository

    git clone https://github.com/mehdimahmoud/n8n-docker.git 
    cd n8n-docker
  2. Create the Docker volume (optional)
    This step is optional, as the volume would be created in step 4 from the docker-compose.yml file.

    docker volume create n8n_data
  3. Set the n8n version
    Edit the .env file to specify the desired n8n version:

    N8N_VERSION=1.97.1
  4. Start n8n using Docker Compose

    docker compose up -d

alt text

Access n8n Dashboard

alt text

Useful Commands

View Logs

docker compose logs -f

Stop n8n

docker compose stop

Start n8n

docker compose start

Update to a Newer Version of n8n

  1. Edit .env and change N8N_VERSION to the desired version.

  2. Pull the new image and recreate the container:

    docker compose pull
    docker compose up -d

Backup n8n Data

docker run --rm -v n8n_data:/data -v $(pwd):/backup ubuntu bash -c 'tar czvf /backup/n8n_data_backup_$(date +%Y%m%d_%H%M%S).tar.gz -C /data .'

Restore n8n Data

# List available backup files
ls -lh n8n_data_backup_*.tar.gz

# Restore a specific backup (replace the filename with the desired timestamped backup)
docker run --rm -v n8n_data:/data -v $(pwd):/backup ubuntu bash -c "cd /data && tar xzvf /backup/n8n_data_backup_YYYYMMDD_HHMMSS.tar.gz --strip 1"

Clean Up (Remove Container but Keep Data)

docker compose down

This removes the container but keeps the n8n_data volume.


Note

  • Your workflows and credentials are stored in the n8n_data Docker volume.

  • To remove all data, delete the volume:

    docker volume rm n8n_data

References

About

This guide will help you deploy n8n locally using Docker Compose, ensuring your data is persistent and easily manageable.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published