How to Self-Host n8n (5-Minute Setup)

In this guide, you’ll set up your own n8n automation server on Railway, create a password-protected n8n instance, and import your first AI-powered automation from a JSON file. The setup can be completed in under 10 minutes, and the source notes that a $5 virtual server can run thousands of automations per month.

  • Intermediate
  • 4 steps
  • By The Rundown University

Rundown Pro

Every course and recording, the certification program and member perks, for $29 a month. Guides stay free.

Go Pro for $29

Step by step 4 steps

  1. Step 1 of 4

    Deploy n8n on Railway

    Go to railway.com/deploy/n8n and click Deploy Now. Sign in with your GitHub account if you haven’t already.

    On the next screen, you’ll see a configuration panel with environment variables. You don’t need to change any of these; the defaults work out of the box. Click Deploy.

    image-2073

    Railway will spin up two containers: a PostgreSQL database to store your workflows and credentials, and the n8n application itself. This takes about 2–3 minutes. You’ll see both containers appear in your Railway dashboard once they’re live.

  2. Step 2 of 4

    Open Your New n8n Instance and Create an Account

    Once the deployment finishes, click the n8n container in your Railway dashboard. You’ll see a generated URL near the top of the page, such as n8n-production-xxxx.up.railway.app. Click it.

    The first time you visit this URL, n8n will ask you to create an account. Enter your email and choose a password. From this point on, your instance is password-protected. Anyone who visits that URL will hit a login screen.

    That’s it. You now have a fully functional n8n server running at your own URL for a fraction of the cloud price.

  3. Step 3 of 4

    Import an AI-Generated Workflow

    Click Create Workflow in your n8n dashboard.

    Instead of building your automation node by node, you can have Claude or ChatGPT design the entire workflow for you as a JSON file. Open Claude or ChatGPT and tell it what you want your automation to do. Be specific about the trigger, the steps, and the output.

    Build me an n8n workflow that runs every morning at 8am, uses OpenAI to search for the latest AI news, writes a short summary memo, and sends it to my email.

    The AI will generate a JSON file that defines the entire workflow: nodes, connections, credentials, and configuration. Save that JSON file to your computer.

    Back in n8n, open your new workflow, click the three-dot menu in the top right, and select Import from File. Choose your JSON file. The entire workflow will appear on your canvas, fully wired up and ready to run.

    image-2074

    From here, add your credentials: API keys for OpenAI, Gmail, Slack, or whatever services the workflow uses. Click any node that needs a credential, hit Create New Credential, paste in your key, and save. n8n stores these permanently so you only do this once per service.

  4. Step 4 of 4

    Test and Activate the Workflow

    Click Test Workflow to do a manual run and make sure everything fires correctly. You’ll see each node light up green as it executes.

    If something breaks, click the failed node to see the error message. Usually it’s a missing credential or a formatting issue in the prompt. You can paste the error message into Claude or ChatGPT for troubleshooting.

    Once it runs cleanly, toggle the workflow to Active in the top right. It will now run on its own based on whatever trigger you set, such as a schedule, webhook, or new row in a spreadsheet.

    Your server runs 24/7 on Railway. You don’t need to keep a browser tab open; the workflows fire in the background automatically.

That's the whole workflow

Mark it complete to keep your progress. The background follows.

Keep learning with Rundown Pro

Guides stay free. This is what Rundown Pro adds:

  • Every course and recording
  • The Rundown Certified Operator program
  • Member perks

$29/mo, cancel anytime

Background and context

Who This Is Useful For

  • Anyone paying $20 a month for AI automations
  • Consultants running automations for multiple teams or clients
  • Intermediate n8n users

What You Will Build

You’ll build a live, password-protected n8n instance running on your own Railway server. In one session, you’ll deploy it, log in, and import your first AI-powered automation from a JSON file.

  • A Railway-hosted n8n server
  • A password-protected n8n login
  • An imported AI-generated workflow
  • Saved credentials for any connected services

What You Need

  • A Railway account
  • A GitHub account, since Railway uses it to sign in
  • Claude or ChatGPT to generate your automation as a JSON file
  • Optional: API keys for any services you want to connect, such as OpenAI, Google Sheets, or Slack

Going Further

  • After your n8n instance is live, you can invite other users by email for team or client work, set up separate Railway instances per client for isolation, and create a Google Cloud project if you want to connect Gmail, Google Sheets, Google Calendar, or other Google services. For a deeper dive, the source recommends the AI Automations Course for learning the full workflow design process from scratch.