Lesson 3 · Module 3: Your AI Operating System on a Private Server
One-click installs with Docker panels: n8n, database and AI models
Video coming soon
Learn it with your tutor on the live board
Key points from the video
Your Business Tools, One Click Away
- Customer messages, bookings and invoices need an engine
- Installing each tool by hand takes days
- A Docker panel turns it into minutes
What You Will Learn
- What Docker containers are, in plain words
- How a Docker panel installs n8n and a database
- How to add a local AI model that fits your server
What a Container Is
- A container is an app packed with everything it needs
- An image is the recipe, a container is the running dish
- Containers stay isolated, so apps don't break each other
The Docker Panel
- A web dashboard for your server, like an app store
- Popular choices: Coolify, Easypanel, Dokploy
- Handles domains, SSL certificates and restarts for you
How the Pieces Fit
- The panel's proxy sends each domain to the right app
- n8n runs your workflows
- Postgres stores data, Ollama runs the AI model
layout: side
direction: TB
components:
user: {kind: users, label: Customers}
proxy: {kind: gateway, label: Panel proxy}
n8n: {kind: service, label: n8n}
db: {kind: database, label: Postgres}
llm: {kind: llm, label: Ollama}
zones:
- {label: Your VPS, contains: [proxy, n8n, db, llm]}
links: [user->proxy, proxy->n8n, n8n->db, n8n->llm]
steps:
- at: "a customer sends a message"
show: [user, proxy]
- at: "inside your private server"
show: all
- at: "follow one booking request"
flow: ["user>proxy: booking", "proxy>n8n", "n8n>llm: classify", "llm>n8n: booking", "n8n>db: save", "db>n8n: ok", "n8n>proxy", "proxy>user: confirmed"] Step 1: Install the Panel
- Then open http://your-server-ip:8000 and create the admin user
- Give the dashboard a domain, then close port 8000 in the firewall
ssh root@your-server-ip
curl -fsSL https://cdn.coollabs.io/coolify/install.sh | sudo bash Step 2: n8n with Its Own Database
services:
n8n:
image: n8nio/n8n
environment:
- DB_TYPE=postgresdb
- DB_POSTGRESDB_HOST=postgres
- DB_POSTGRESDB_DATABASE=n8n
- DB_POSTGRESDB_USER=n8n
- DB_POSTGRESDB_PASSWORD=change-me
- N8N_HOST=n8n.yourshop.com
volumes:
- n8n_data:/home/node/.n8n
depends_on:
- postgres
postgres:
image: postgres:16
environment:
- POSTGRES_USER=n8n
- POSTGRES_PASSWORD=change-me
- POSTGRES_DB=n8n
volumes:
- pg_data:/var/lib/postgresql/data
volumes:
n8n_data:
pg_data: Step 3: Pick an AI Model That Fits
- Pull it in the Ollama container's terminal: ollama pull llama3.1:8b
- n8n reaches it at http://ollama:11434
models = {"Llama 3.2 3B": 3, "Llama 3.1 8B": 8,
"Qwen 2.5 14B": 14, "Qwen 2.5 32B": 32}
bytes_per_param = 0.5 # 4-bit quantized
overhead_gb = 1.5 # runtime and context
server_ram_gb = 16
free_for_ai = server_ram_gb - 4 # n8n, Postgres, system
for name, billions in models.items():
need = billions * bytes_per_param + overhead_gb
verdict = "fits" if need <= free_for_ai else "too big"
print(f"{name}: about {need:.1f} GB -> {verdict}") Worked Example: Lina's Message Sorter
- Webhook receives a customer message
- Local model labels it: booking, lead or question
- n8n saves it in Postgres and replies
Common Mistake: Leaving Doors Open
- Database port open to the whole internet
- No volume, so an update wipes your data
- Model too big, so the server freezes
Recap
- Containers package apps; a panel manages them by clicking
- n8n plus Postgres, with volumes, is your automation core
- Size the AI model to your free memory before you download
Your Exercise
- Install a Docker panel on your VPS
- Deploy n8n with Postgres on your own subdomain
- Add Ollama, pull a model that fits, and test one prompt
Transcript
Your Business Tools, One Click Away. Picture Lina, who runs a small online skincare shop. Every morning she wakes up to forty customer messages, three booking requests and a pile of invoices to send. Last lesson, you rented a private server and locked it down. But a bare server is just an empty room, so how do you fill it with the tools that actually do the work? A few years ago, that meant days of typing install commands and fixing errors. Today, a Docker panel lets you install n8n, a database and even an AI model with a few clicks. That's what this lesson is about.
What You Will Learn. By the end of this lesson, you'll be able to do three things. First, explain what a Docker container is without any jargon, so you can describe it to a client. Second, use a Docker panel to install n8n, your automation engine, together with a database that keeps its data safe. Third, add a local AI model to the same server and pick a model size that actually fits in its memory. Together, these three pieces are the core of the AI operating system we're building in this module.
What a Container Is. Think of a shipping container. A ship doesn't care whether a box holds shoes or bananas, because every box has the same shape. Docker does the same for software. A container is an app packed with everything it needs to run, so it behaves the same on any server. The thing you download is called an image. Think of the image as a recipe and the container as the dish you cook from it. You can cook many dishes from one recipe. And because each container is sealed, updating n8n is far less likely to break your database.
The Docker Panel. Docker on its own is controlled by typing commands. A Docker panel puts a friendly web dashboard on top, a bit like an app store for your server. You pick n8n from a list, type your domain, and click deploy. Popular free options include Coolify, Easypanel and Dokploy. You may also hear of Portainer, which manages containers but needs a separate proxy for domains and SSL. On screen is Coolify, which we'll use as our example. The big win is that the panel also handles your SSL certificate, the padlock in the browser, and restarts your apps if they crash. Those are the exact jobs that used to eat a whole weekend.
How the Pieces Fit. Here's the shape of what we're building. When a customer sends a message, it first reaches the panel's proxy. A reverse proxy is like a receptionist: it reads the address on the envelope and walks it to the right office. Everything else lives inside your private server. n8n runs the workflows, Postgres is the database that remembers things, and Ollama runs the AI model. Now follow one booking request. The proxy hands it to n8n, n8n asks the model what kind of message it is, saves the booking in Postgres, and sends back a confirmation.
Step 1: Install the Panel. Let's take this slowly, because it's the only part with a terminal. First, connect to your server with SSH, the secure remote login you set up last lesson. Second, paste Coolify's official install script. It downloads Docker and the panel, and takes about five minutes. Third, open your server's address on port eight thousand in a browser and create the admin account right away, because the first person to open that page becomes the owner. Fourth, once you give the dashboard its own domain in Coolify's settings, close port eight thousand in your firewall, so that door doesn't stay open. That's it. From here on, everything happens by clicking in the dashboard.
Step 2: n8n with Its Own Database. In the panel, choose the n8n template that comes with Postgres. Behind the scenes, the panel writes a file like this one. It starts two containers, n8n and Postgres, and tells n8n to store its workflows in that database, logging in with the same user and password. The panel fills those in for you, but if you ever write this file yourself, replace change-me with a long random password. You just set your domain, something like n8n dot yourshop dot com. Notice the volumes lines. A volume is a folder on the server's disk that survives when a container is rebuilt. Without it, every update would wipe Lina's workflows and customer history. Click deploy, wait a minute, and n8n opens with a padlock.
Step 3: Pick an AI Model That Fits. Now add Ollama from the panel's template list. Before downloading a model, check that it fits. A model's size is counted in parameters, the numbers it learned during training, so eight B means eight billion of them. Quantized models squeeze each parameter into about half a byte, like saving a photo as a smaller JPEG. So memory needed is roughly billions times zero point five, plus one and a half gigabytes of overhead. On a sixteen gigabyte server, keep four for n8n and Postgres. The run shows the small and medium models fit, and the thirty-two billion one doesn't. Ollama has no web page, so open its container's terminal in the panel and type ollama pull with the model's name. n8n reaches it at ollama, port one one four three four.
Worked Example: Lina's Message Sorter. Let's connect the three pieces for Lina. In n8n, a webhook node receives each message from her website chat. An AI node calls Ollama at its internal address, the one ending in port one one four three four, with a short instruction: label this message as booking, lead or question. A Postgres node saves the message and its label, so nothing is lost. Then a switch node branches: bookings get a link to her calendar, hot leads trigger an alert on her phone, and simple questions get a drafted reply. And not one customer message ever leaves her own server.
Common Mistake: Leaving Doors Open. The most common mistake is publishing the database port to the internet. A port is a numbered door on your server, and Postgres listens on door five four three two. Bots scan the whole internet for open database doors every day, so your client's data could be stolen within hours. Keep Postgres internal: only n8n should reach it, through the panel's private network. Two more traps follow close behind. A container without a volume loses its data on the next update. And a model bigger than your free memory makes the whole server freeze.
Recap. Let's recap. First, a container is an app packed with everything it needs, and a Docker panel lets you install and run containers with clicks instead of commands. Second, n8n with its own Postgres database, both stored on volumes, is the automation core of your AI operating system. Third, a local model is sized with simple maths: billions of parameters times half a byte, plus overhead, and it must fit in the memory left after everything else. With those three, a client's private AI stack can be set up in an afternoon.
Your Exercise. Now it's your turn. Before the next lesson, install a Docker panel on your server. Coolify is a good start, but any panel works. Deploy n8n with Postgres on your own subdomain and make sure the padlock shows. Then add Ollama, use the memory formula to pick a model that fits, pull it from the Ollama container's terminal, and send it one test prompt from an n8n workflow, like sorting a sample customer message. Write down your server's memory and the model you chose. Next lesson, we'll give your agents real memory in that database.
Explore the animation
The animations from the video, exact and live: play them, pause, drag the slider or jump to a step at your own pace.
Loading the animation...
Lesson summary
- Video watched
- Containers package apps; a panel manages them by clicking
- n8n plus Postgres, with volumes, is your automation core
- Size the AI model to your free memory before you download