Skip to content

Taching/n8n-raspberry

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

n8n Self-Hosted Setup

Self-hosted n8n workflow automation platform using Docker. Works on macOS (for testing) and Raspberry Pi (for production).

Prerequisites

  • Docker and Docker Compose installed
  • For Raspberry Pi: Docker installed on Raspbian/Raspberry Pi OS

Quick Start

1. Clone the repository

git clone <your-repo-url>
cd n8n-selfhost

2. Set up environment variables

cp .env.example .env

Edit .env and update the following:

  • N8N_BASIC_AUTH_USER: Your username
  • N8N_BASIC_AUTH_PASSWORD: Your password
  • GENERIC_TIMEZONE: Your timezone (e.g., Asia/Tokyo, America/New_York)

3. Start n8n

docker-compose up -d

4. Access n8n

Open your browser and navigate to:

Login with the credentials you set in the .env file.

Testing on macOS

Before deploying to Raspberry Pi, test everything on your MacBook:

# Start n8n
docker-compose up -d

# View logs
docker-compose logs -f

# Stop n8n
docker-compose down

# Stop and remove volumes (reset everything)
docker-compose down -v

Deploying to Raspberry Pi

  1. Copy the entire directory to your Raspberry Pi:

    scp -r . pi@<raspberry-pi-ip>:~/n8n-selfhost
  2. SSH into your Raspberry Pi:

    ssh pi@<raspberry-pi-ip>
  3. Navigate to the directory and start:

    cd ~/n8n-selfhost
    docker-compose up -d

Configuration

Environment Variables

  • N8N_PORT: Port to run n8n on (default: 5678)
  • N8N_BASIC_AUTH_ACTIVE: Enable/disable basic auth (default: true)
  • N8N_BASIC_AUTH_USER: Username for login
  • N8N_BASIC_AUTH_PASSWORD: Password for login
  • N8N_HOST: Hostname (default: localhost)
  • N8N_PROTOCOL: Protocol (http or https)
  • WEBHOOK_URL: Webhook URL for external access
  • GENERIC_TIMEZONE: Timezone setting

Data Persistence

  • Workflow data is stored in the Docker volume n8n_data
  • The local-files directory can be used to share files with n8n

Useful Commands

# Start n8n
docker-compose up -d

# Stop n8n
docker-compose down

# View logs
docker-compose logs -f n8n

# Restart n8n
docker-compose restart

# Update to latest version
docker-compose pull
docker-compose up -d

# Backup data
docker run --rm -v n8n-selfhost_n8n_data:/data -v $(pwd):/backup alpine tar czf /backup/n8n-backup.tar.gz -C /data .

# Restore data
docker run --rm -v n8n-selfhost_n8n_data:/data -v $(pwd):/backup alpine tar xzf /backup/n8n-backup.tar.gz -C /data

Security Notes

  • Change the default password in .env
  • For production use, consider setting up HTTPS with a reverse proxy (nginx/Traefik)
  • Keep your .env file secure and never commit it to git
  • Regularly update n8n to the latest version

Troubleshooting

Port already in use

Change N8N_PORT in .env to a different port.

Can't access from other devices

Make sure your firewall allows the port and use your machine's IP address instead of localhost.

Raspberry Pi performance

For better performance on Raspberry Pi, consider using Raspberry Pi 4 with at least 2GB RAM.

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •