How to Install n8n with Podman on Opalstack

Install n8n on Opalstack with Podman for cost-effective workflow automation. Complete guide covering setup, authentication, and backups on their valuestack.

n8n is an open-source workflow automation tool similar to Zapier. Opalstack is a modern hosting provider that supports Podman containers on their AlmaLinux 9 servers. Podman lets you run containers in user-space without needing root access. I have been hosting with Opalstack since they started (I was with Webfaction, their previous avatar, before that). Recently I migrated to their AlmaLinux servers and with that it has now become possible to run n8n on Opalstack itself (I used to host on Railway earlier).

# Prerequisites

  • Opalstack account on AlmaLinux 9 server
  • Domain or subdomain configured
  • Basic terminal/SSH knowledge

# Step 1: Create App and Site in Opalstack

Log into your Opalstack control panel and create an application:

  1. Go to ApplicationsAdd Application
  2. Choose Custom App
  3. Name it (e.g., "n8n")
  4. Note the assigned port number - you'll need this later
  5. Save

Then create a site:

  1. Go to SitesAdd Site
  2. Enter your domain/subdomain (e.g., flows.yourdomain.com)
  3. Link it to the n8n app you just created
  4. Enable HTTPS/SSL
  5. Save

If you're using Cloudflare, set SSL mode to "Full" or "Full (Strict)".

# Step 2: SSH into Your Server

ssh your_username@your_server.opalstack.com

Verify Podman is available:

podman --version

# Step 3: Create Persistent Storage

Create a volume to store n8n's data (SQLite database, workflows, credentials):

podman volume create n8n_data

This volume persists even if you delete and recreate the container.

# Step 4: Run n8n Container

Replace YOUR_ASSIGNED_PORT with the port from Step 1, and choose secure passwords for both Basic Auth and your n8n owner account later:

podman run -d \
  --name n8n \
  --memory=450m \
  --memory-swap=450m \
  -p YOUR_ASSIGNED_PORT:5678 \
  -e N8N_HOST=autos.yourdomain.com \
  -e WEBHOOK_URL=https://flows.yourdomain.com \
  -e N8N_BASIC_AUTH_ACTIVE=true \
  -e N8N_BASIC_AUTH_USER=workflow_manager_42 \
  -e N8N_BASIC_AUTH_PASSWORD=YourStrongPassword123! \
  -e N8N_SECURE_COOKIE=true \
  -e GENERIC_TIMEZONE=Asia/Kolkata \
  -e EXECUTIONS_DATA_SAVE_ON_SUCCESS=none \
  -e EXECUTIONS_DATA_SAVE_ON_ERROR=all \
  -e EXECUTIONS_DATA_MAX_AGE=168 \
  -v n8n_data:/home/node/.n8n \
  --restart=always \
  docker.n8n.io/n8nio/n8n

Key parameters:

  • --memory=450m - Limits memory to 450MB (important for Opalstack's 512MB Value Stack)
  • -p YOUR_PORT:5678 - Maps your Opalstack port to n8n's internal port 5678
  • N8N_BASIC_AUTH_* - Adds HTTP Basic Auth (first layer of security, browser popup)
  • EXECUTIONS_DATA_* - Reduces memory usage by limiting execution history (You can set this later on n8n UI for individual workflows too)
  • --restart=always - Auto-restarts on crashes

Verify it's running:

podman ps
podman logs n8n

# Step 5: Access n8n

Open your browser to https://flows.yourdomain.com/

You'll see two login prompts:

  1. HTTP Basic Auth (browser popup) - Enter the username/password from N8N_BASIC_AUTH_USER and N8N_BASIC_AUTH_PASSWORD
  2. n8n Owner Account (first-time setup page) - Create your n8n admin account with email and a different password

These are two separate authentication layers. The Basic Auth keeps bots and unauthorized users out before they even reach n8n. The owner account is for managing workflows inside n8n.

# Step 6: Auto-Start After Server Reboot

The --restart=always flag handles crashes, but not server reboots. Add a cron job to start n8n automatically:

Create a startup script:

nano ~/start_n8n.sh

Add this content:

#!/bin/bash
sleep 30
/usr/bin/podman start n8n

Make it executable:

chmod +x ~/start_n8n.sh

Add to crontab:

crontab -e

Add these lines:

@reboot ~/start_n8n.sh > /dev/null 2>&1
*/5 * * * * /usr/bin/podman ps | grep -q n8n || /usr/bin/podman start n8n > /dev/null 2>&1

The first line starts n8n on reboot. The second checks every 5 minutes and restarts if it's stopped.

# Backups and Restore

# Backup Options

n8n offers two backup approaches:

1. Export Individual Workflows (Quick)

In the n8n UI, open any workflow and click the "..." menu → Download. This saves the workflow as a JSON file. Good for version control or sharing specific workflows.

2. Full Database Backup (Recommended)

Backup the entire volume including all workflows, credentials (encrypted), and settings:

podman volume export n8n_data > ~/n8n_backup_$(date +%Y%m%d).tar

This creates a dated backup file like n8n_backup_20250209.tar.

# Automated Backups

Create a backup script:

nano ~/backup_n8n.sh

Add:

#!/bin/bash
BACKUP_DIR=~/backups
mkdir -p $BACKUP_DIR
podman volume export n8n_data > $BACKUP_DIR/n8n_backup_$(date +%Y%m%d).tar
# Keep only last 3 backups
cd $BACKUP_DIR
ls -t n8n_backup_*.tar | tail -n +4 | xargs -r rm

Make executable and add to cron:

chmod +x ~/backup_n8n.sh
crontab -e

Add for weekly Sunday backups:

0 2 * * 0 ~/backup_n8n.sh

# Restore from Backup

To restore a backup:

# Stop and remove container
podman stop n8n
podman rm n8n

# Delete old volume and create new one
podman volume rm n8n_data
podman volume create n8n_data

# Import backup
podman volume import n8n_data < ~/backups/n8n_backup_20250209.tar

# Recreate container (run the podman run command from Step 4)

After recreating the container, all your workflows, credentials, and settings will be restored.

# Download Backups Locally

To keep backups on your Mac:

scp your_username@your_server.opalstack.com:~/backups/n8n_backup_*.tar ~/Downloads/

# Useful Commands

# View logs
podman logs n8n
podman logs -f n8n  # Follow in real-time

# Stop/Start/Restart
podman stop n8n
podman start n8n
podman restart n8n

# Check memory usage
podman stats n8n --no-stream

# Update to latest n8n version
podman pull docker.n8n.io/n8nio/n8n
podman stop n8n
podman rm n8n
# Then run the podman run command again from Step 4

# Troubleshooting

Blank page or MIME type errors: Don't use custom N8N_PATH - stick with the root path.

Can't access n8n: Verify container is running (podman ps), port matches your Opalstack app port, and Cloudflare SSL is set to "Full".

Memory errors: Check usage with podman stats n8n. The 512MB limit on Value Stack is tight - the configuration above optimizes for this.

Port confusion: Always use -p OPALSTACK_PORT:5678 where OPALSTACK_PORT is from your control panel and 5678 is n8n's internal port (never change this).

# What You've Built

You now have a self-hosted n8n instance running on Opalstack with:

  • Persistent SQLite database
  • Two-layer authentication (Basic Auth + n8n login)
  • Auto-restart on crashes and server reboots
  • Optimized memory usage for 512MB limit
  • Automated backups
  • HTTPS via your domain

Total cost: Just your Opalstack hosting fee, no per-execution charges like SaaS alternatives.

Link to opalstack is an affiliate link.

Published On:
Under: #tech