Tutorials

How to Set Up n8n on Hostinger VPS: Complete Guide

By Olaleye Ibrahim Olanrewaju8 min read
What you'll build: A self-hosted n8n instance on Hostinger VPS with three automations: a daily VPS update checker, a Llama 3.2 AI chatbot, and an AI-powered Hacker News digest.

1. Install n8n on Your VPS

  1. Purchase any Hostinger VPS plan (KVM 2 is the most popular choice).
  2. After payment, you'll be redirected to the onboarding flow.
  3. Hostinger will automatically select the best server location for you.
  4. In the next step, search for the n8n template and select it.
  5. Create a root password for your VPS.
  6. Press Continue and wait for the setup to finish.
💡 Tip

Hostinger's n8n template handles Docker and reverse proxy configuration, eliminating the need for manual server setup.


2. First Login to n8n

  1. Once setup is complete, open the n8n tool (via the link in your Hostinger dashboard).
  2. On first login, set up the owner account:
    • Email address
    • First name & last name
    • Password
  3. You can now start creating workflows.

3. Workflow: Daily VPS Update Checker

A workflow that checks your VPS for package updates every day and emails you if any are found.

How It Works

Schedule Trigger (every day at midnight)
  → SSH into VPS → run: apt list --upgradable
    → Format the list as HTML
      → IF updates exist → Send email via SMTP

Steps to Build

  1. Schedule Trigger — Set to run every day at midnight.
  2. SSH Node — Connect to your VPS using SSH credentials and run:
    bashapt list --upgradable
  3. HTML Formatter — Format the package list into readable HTML.
  4. IF Node — Check whether any upgradable packages were found.
  5. Email Node — Send the results to your email via your SMTP account.
💡 Tip

This starter workflow keeps your VPS secure and introduces the basics of n8n triggers, SSH nodes, conditionals, and email sending.


4. Workflow: Self-Hosted Llama 3.2 AI Chatbot

Host your AI model on your VPS to chat directly inside n8n without external API keys.

Step 1: Set Up Ollama on Your VPS

Log into your VPS via SSH (use the browser terminal in hPanel).

Run a new Docker container with the Ollama image on the default network:

bashdocker run -d --name ollama --network bridge ollama/ollama
📝 Note

This may take a few minutes as it downloads the image. Connecting to the default network allows the n8n container to communicate with the Ollama container.

Step 2: Download and Run Llama 3.2

bashdocker exec -it ollama ollama run llama3.2

The model downloads and starts automatically.

Step 3: Connect Llama to n8n

  1. In n8n, add an AI Agent node to your workflow.
  2. Press the + button and choose Chat Model from the dropdown.
  3. Set up credentials:
    • Base URL: http://ollama
    • Port: 11434 (default Ollama port)
  4. Select model: llama3.2
  5. Set the trigger to On Chat Message Received.
  6. Press Chat and start talking to your private AI!
📝 Note

This example demonstrates the basics of connecting an AI agent to a private language model. You can extend it into customer support bots, content generators, data processors, and more — all running on your own infrastructure.


5. Workflow: Daily Hacker News Summary with AI

A workflow that scrapes the top 5 Hacker News stories, summarizes them with AI, and emails you the digest every afternoon.

How It Works

Schedule Trigger (every day at 4:00 PM)
  → HTTP Request (scrape Hacker News homepage)
    → Extract HTML content
      → Split & limit to top 5 stories
        → Aggregate into one request
          → AI Agent (OpenAI) summarizes each story
            → Send email via SMTP

Steps to Build

  1. Schedule Trigger — Run daily at 4:00 PM.
  2. HTTP Request Node — Fetch the Hacker News homepage.
  3. HTML Extract Node — Pull out the article data.
  4. Split + Limit Node — Keep only the top 5 stories.
  5. Aggregate Node — Combine into a single payload for the AI.
  6. AI Agent Node — Attach an OpenAI Chat Model (requires your OpenAI API key). The AI reads and summarizes each article.
  7. Email Node — Send the summary to your inbox.
💡 Tip

Press the Test workflow button to run the workflow on demand. You'll see the data flow through each node in real time.


6. n8n Template Catalog

n8n includes a built-in catalog with 1,000+ ready-to-use templates.

How to Use

  1. Click the Templates link on the left sidebar in n8n.
  2. Browse or search for a workflow.
  3. Click Use workflow on any template.
  4. The template imports directly into your self-hosted instance.
  5. Set up the required credentials (the template tells you what's needed).
  6. Start using it immediately!

Quick Reference: Commands

bash# Run Ollama container
docker run -d --name ollama --network bridge ollama/ollama

# Download and run Llama 3.2
docker exec -it ollama ollama run llama3.2

Based on a tutorial by Valentinas, Head of VPS at Hostinger.

Continue Reading

Related articles