Lección 3 · Módulo 3: Your AI Operating System on a Private Server
One-click installs with Docker panels: n8n, database and AI models
- Explain what a Docker container is, in plain words
- Install n8n and a database with a Docker panel
- Add a local AI model that fits your server
Why this matters
Most small businesses lose hours each day to messages, bookings and invoices that no one has time to handle. Setting up the tools that handle them used to take days of typing server commands and fixing errors. A Docker panel now installs n8n, a database and a local AI model with a few clicks, so you can build a private automation engine for a client in an afternoon.
Key ideas
- Container. A container is an app packed with everything it needs, so it runs the same way on any server. Think of it as a sealed box that keeps apps from breaking each other.
- Docker panel. A web dashboard that sits on top of Docker, like an app store for your server. It also handles domains, SSL certificates (the padlock in the browser) and automatic restarts.
- Volume. A folder on the server's disk that survives when a container is rebuilt or updated. Without one, an update can wipe a client's workflows and history.
- Right-sizing a model. A model's memory need is roughly its billions of parameters times 0.5 (for a 4-bit quantized model), plus about 1.5 GB of overhead. Worked example: an 8B model needs 8 × 0.5 + 1.5 = 5.5 GB. On a 16 GB server with 4 GB kept for n8n and Postgres, 12 GB is free, so it fits.
Try it before you watch
A 14 billion parameter model is quantized to 0.5 bytes per parameter and has 1.5 GB of overhead. On a server with 16 GB of RAM, and 4 GB kept for n8n and Postgres, does it fit?
Show answerHide answer
It needs 14 × 0.5 + 1.5 = 8.5 GB. The free memory is 16 − 4 = 12 GB, so it fits. This shows that the memory formula decides the choice, not the model's name.
Words to know
- Image: the downloadable recipe a container is started from. The running copy is the container.
- Postgres: an open-source database that stores structured data, here the n8n workflows and customer records.
- Port: a numbered door on a server. Each service listens on one, and an open port is a way in from the internet.
- Reverse proxy: a gateway that reads the web address of each request and passes it to the right app, like a receptionist.
- Quantized model: a model whose numbers are stored with fewer bits, so it uses much less memory at a small cost in quality.
- SSH: a secure way to log in to a remote server and type commands on it.
What to watch for
- Watch how the panel turns a template into the two containers, n8n and Postgres, and the volumes that keep their data.
- Notice the memory formula applied to two models, and which one is too big for the server.
- Follow the booking request from the proxy through n8n, Ollama and Postgres, and note why Postgres should never be open to the internet.
Apréndelo con tu tutor en la pizarra en vivo
Puntos clave del video
Your Business Tools, One Click Away
- Customer messages, bookings and invoices need an engine
- Days of hand setup for each tool
- A Docker panel turns it into minutes
layout: full
parts:
shop: {chip: "Lina's shop", sub: "Skincare online", icon: store}
server: {box: "Private server", holds: [shop]}
steps:
- at: "Picture Lina"
highlight: shop
note: "Lina, online skincare"
- at: "forty customer messages"
vortex: {into: shop, words: [customer, messages, bookings, invoices]}
count: {to: 40, label: messages}
- at: "three booking requests"
note: "3 booking requests"
- at: "a pile of invoices"
note: "a pile of invoices"
- at: "rented a private server"
zoom_out: server
note: "Last lesson: a private server"
- at: "an empty room"
highlight: server
note: "a bare server is empty"
- at: "days of typing"
note: "days of typing commands"
- at: "a Docker panel"
note: "one dashboard"
- at: "an AI model"
spokes: {of: server, items: [n8n, Database, AI model]}
- at: "a few clicks"
note: "a few clicks"
- at: "this lesson is about"
highlight: server
note: "This lesson" What You Will Learn
- Explain what a Docker container is, in plain words
- Install n8n and a database with a Docker panel
- Add a local AI model that fits your server
layout: full
parts:
course: {chip: "Your AI server", sub: "Three skills", icon: server}
steps:
- at: "three things"
vortex: {into: course, words: [three, things, container, panel, model]}
count: {to: 3, label: skills}
- at: "a Docker container"
note: "explain a container"
- at: "use a Docker panel"
note: "install with a panel"
- at: "a local AI model"
note: "add a local model"
- at: "operating system"
highlight: course
note: "the AI operating system" What a Container Is
- Packed with everything it needs, an app becomes a container
- An image is the recipe, a container is the running dish
- Sealed boxes keep apps from breaking each other
layout: full
parts:
app: {chip: "App", sub: "Everything it needs", icon: package}
shell: {box: "Container", holds: [app]}
img: {chip: "Image", sub: "The recipe", icon: file-text}
dock: {box: "Docker", holds: [shell, img]}
steps:
- at: "shipping container"
zoom_out: shell
note: "a shipping container"
- at: "shoes or bananas"
note: "every box, same shape"
- at: "Docker does the same"
note: "the same idea for software"
- at: "packed with everything"
highlight: app
note: "an app packed with what it needs"
- at: "called an image"
zoom_out: dock
note: "the image is downloaded"
- at: "image as a recipe"
highlight: img
note: "image = recipe"
- at: "cook many dishes"
highlight: shell
note: "many dishes, one recipe"
- at: "each container is sealed"
highlight: shell
note: "sealed, so apps stay apart" 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
layout: full
parts:
server: {chip: "Your server", sub: "Runs Docker", icon: server}
panel: {box: "Docker panel", holds: [server]}
steps:
- at: "controlled by typing commands"
highlight: server
note: "typing commands"
- at: "a friendly web dashboard"
zoom_out: panel
note: "a web dashboard"
- at: "pick n8n from a list"
highlight: panel
note: "pick, type domain, deploy"
- at: "options include Coolify"
spokes: {of: panel, items: [Coolify, Easypanel, Dokploy]}
- at: "hear of Portainer"
note: "Portainer needs its own proxy"
- at: "the one we'll use"
highlight: panel
note: "our example: Coolify"
- at: "handles your SSL certificate"
note: "SSL and restarts, handled"
- at: "a whole weekend"
highlight: server
note: "a whole weekend saved" How the Pieces Fit
- The proxy sends each domain to the right app
- n8n carries out your workflows
- Postgres remembers the data, Ollama answers with AI
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: "receptionist"
highlight: proxy
note: "reads the address"
- at: "inside your private server"
show: all
- at: "carries out the workflows"
highlight: n8n
- at: "Postgres is the database"
highlight: db
- at: "Ollama answers with the AI model"
highlight: llm
- at: "follow one booking request"
flow: ["user>proxy: booking", "proxy>n8n"]
- at: "asks the model what kind"
flow: ["n8n>llm: classify", "llm>n8n: booking"]
- at: "saves the booking in Postgres"
flow: ["n8n>db: save", "db>n8n: ok"]
- at: "sends back a confirmation"
flow: ["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
- Booking, lead or question: the local model labels it
- Postgres saves every message, then a reply goes out
layout: full
parts:
wh: {chip: "n8n webhook", sub: "Gets each message", icon: webhook}
llm: {chip: "Ollama labels it", sub: "Booking, lead, question", icon: brain}
db: {chip: "Save in Postgres", sub: "Nothing is lost", icon: database}
flow: {box: "n8n flow", holds: [wh, llm, db]}
rep: {chip: "Reply or alert", sub: "Lina", icon: bell}
shop: {box: "Lina's shop", holds: [flow, rep]}
steps:
- at: "three pieces for Lina"
highlight: flow
note: "three pieces"
- at: "webhook node receives"
highlight: wh
note: "receives each message"
- at: "calls Ollama at its"
highlight: llm
note: "label: booking, lead, question"
- at: "Postgres node saves"
highlight: db
note: "nothing is lost"
- at: "a switch node branches"
zoom_out: flow
note: "a switch node branches"
- at: "bookings get a link"
note: "bookings: a calendar link"
- at: "hot leads trigger an alert"
zoom_out: shop
note: "hot leads: alert on phone"
- at: "simple questions get"
note: "questions: drafted reply"
- at: "ever leaves her own server"
highlight: shop
note: "stays on her server" 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
layout: full
parts:
db: {chip: "Postgres", sub: "Database", icon: database}
srv: {box: "Your server", holds: [db]}
bots: {chip: "Bots", sub: "Scan for open doors", icon: bot}
net: {box: "The internet", holds: [srv, bots]}
steps:
- at: "publishing the database port"
highlight: db
note: "database port open"
- at: "numbered door on your server"
zoom_out: srv
note: "port 5432: a numbered door"
- at: "Bots scan the whole"
zoom_out: net
note: "bots scan every day"
- at: "stolen within hours"
highlight: db
note: "data stolen within hours"
- at: "Keep Postgres internal"
highlight: db
note: "only n8n gets in"
- at: "Two more traps"
note: "two more traps"
- at: "without a volume"
highlight: srv
note: "no volume, no data"
- at: "makes the whole server freeze"
highlight: srv
note: "the server freezes" Recap
- A container packs an app with everything it needs
- n8n plus Postgres, with volumes, is your automation core
- Pick a local model that fits the memory
layout: full
parts:
app: {chip: "Container", sub: "App, packed", icon: package}
pod: {box: "Docker panel", holds: [app]}
core: {chip: "n8n + Postgres", sub: "Automation core", icon: workflow}
stack: {box: "Your AI OS", holds: [pod, core]}
model: {chip: "AI model", sub: "Fits the memory", icon: brain}
top: {box: "Your server", holds: [stack, model]}
steps:
- at: "Let's recap"
highlight: app
note: "Recap"
- at: "a container is an app"
highlight: app
note: "an app, packed"
- at: "Docker panel lets you"
zoom_out: pod
note: "clicks, not commands"
- at: "Second, n8n with its own"
zoom_out: stack
note: "n8n with Postgres"
- at: "automation core of"
highlight: core
note: "the automation core"
- at: "Third, a local model"
zoom_out: top
note: "a local model"
- at: "sized with simple maths"
highlight: model
note: "sized to fit the memory"
- at: "With those three"
highlight: top
note: "a private AI stack" 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
layout: side
objects:
eq: {tex: '\text{memory} = \text{billions} \times 0.5 + 1.5', pos: top}
ex: {tex: '8 \times 0.5 + 1.5 = 5.5', pos: top}
note: {text: "a model that fits", pos: bottom}
steps:
- at: "your turn"
show: [eq]
- at: "install a Docker panel"
show: [note]
- at: "Deploy n8n with Postgres"
highlight: note
- at: "memory formula"
highlight: eq
- at: "send it one test prompt"
show: [ex]
- at: "Write down your server"
highlight: ex
- at: "Next lesson"
highlight: note Transcripción
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. Coolify is the one 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. 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 carries out the workflows, Postgres is the database that remembers things, and Ollama answers with 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.
Explora las animaciones
Las animaciones del video, exactas y en vivo: reprodúcelas, pausa, arrastra el control deslizante o salta a un paso a tu propio ritmo.
Loading the animation...
Loading the animation...
Loading the animation...
Loading the animation...
Loading the animation...
Loading the animation...
Loading the animation...
Loading the animation...
Loading the animation...
Responde todas las preguntas y luego comprueba. Apruebas con 70%; puedes intentarlo las veces que quieras.
Resumen de la lección
- Lectura
- Video visto
- Cuestionario aprobado (70%)
- A container packs an app with everything it needs
- n8n plus Postgres, with volumes, is your automation core
- Pick a local model that fits the memory