Skip to content

Instantly share code, notes, and snippets.

@codepediair
Last active November 26, 2025 11:52
Show Gist options
  • Select an option

  • Save codepediair/fd9408b3e65542bb09e997bc8665e469 to your computer and use it in GitHub Desktop.

Select an option

Save codepediair/fd9408b3e65542bb09e997bc8665e469 to your computer and use it in GitHub Desktop.
setup server for install docker ollama and n8n in my own VPS (base on this tutorial https://github.com/mikemurphyco/Tutorials/tree/main)

VPS Setup: Ollama + Gemma + n8n


Usage guide

1 . Remote to your VPS by SSH 2 . input this line and every thing do Automatically

curl -sL https://gist.githubusercontent.com/codepediair/fd9408b3e65542bb09e997bc8665e469/raw/fe2331cb92d0e0a69f4c3984172ca17ab82d4f7c/setup.sh | bash
#!/bin/bash
# ==============================
# VPS Setup Script for Ollama + n8n + Gemma model
# ==============================
# Update & upgrade system
echo "Updating system..."
sudo apt update && sudo apt upgrade -y
# Install essential packages
echo "Installing required packages..."
sudo apt install -y curl wget git unzip ufw
# Install Docker
echo "Installing Docker..."
curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh
sudo systemctl enable docker
sudo systemctl start docker
# Install Docker Compose
echo "Installing Docker Compose..."
sudo curl -L "https://github.com/docker/compose/releases/download/2.24.6/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
# Setup firewall
echo "Configuring firewall..."
sudo ufw allow OpenSSH
sudo ufw allow 5678/tcp # Example port for n8n
sudo ufw allow 11434/tcp # Example port for Ollama
sudo ufw enable
# Pull Ollama Docker image
echo "Pulling Ollama Docker image..."
docker pull ollama/ollama:latest
# Run Ollama container
echo "Starting Ollama container..."
docker run -d --name ollama -p 11434:11434 ollama/ollama:latest
# Install Gemma model inside Ollama container
echo "Installing Gemma model..."
docker exec ollama ollama pull gemma
# Run n8n container
echo "Starting n8n container..."
docker run -d --name n8n -p 5678:5678 n8nio/n8n:latest
echo "✅ Setup complete! Ollama running on port 11434 with Gemma model installed, and n8n on port 5678."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment