Lesson 6 · Module 3: Your AI Operating System on a Private Server
Backups, updates and monitoring so your server stays healthy
- Back up workflows, data and documents, and prove it
- Update Docker apps without breaking your agents
- Check vital signs and get phone alerts
Why this matters
A small business running its own AI agents on a private server depends on that machine being up, its data being recoverable and its software being safe. A full disk, a crashed database or an update gone wrong can silence the agents for days, and a backup that was never tested is no protection at all. This lesson shows how to back up, update and watch the server so that these failures are caught early, or prevented altogether.
Key ideas
- Backup. A copy of your data kept somewhere else, so a crash or deletion costs hours rather than everything. Keep the copies on a separate storage place, not on the same disk as the live data.
- 3-2-1 rule. Keep three copies of important data, on two different kinds of storage, with one copy off the server. For example, the original plus two backups gives three copies in total.
- Retention. A rule for how long each copy is kept. Example: keep the last 7 daily backups, plus 4 Sunday backups from the last 5 weeks. From 40 nightly backups, that keeps 7 + 4 = 11 and deletes 40 - 11 = 29.
- Restore test. A backup only counts once you have restored it into a separate test database and checked that the numbers match the live data.
- Pinned version. A fixed version number for an app, such as
n8n:1.64.0, instead oflatest. It means updates happen only when you choose them. - Trend alert. A warning set before a failure, such as disk usage passing 80 percent, so you have time to act.
Try it before you watch
If you keep 3 copies of your data, one of them off the server, and the other two on different kinds of storage, which rule are you following? Name the rule and the number of copies in its name.
Show answerHide answer
The 3-2-1 rule. It means three copies of your data, on two different kinds of storage, with one copy off the server. The rule's name matches its counts: three copies, two kinds, one offsite.
Words to know
- Backup: a copy of your data kept apart from the live system, so you can recover after a failure.
- Offsite: stored in a place away from your server, such as a storage bucket run by another provider.
- Restore: copying a backup back into a working database so you can check it or use it.
- Dump: a file that contains a full copy of a database's data, which can be loaded again later.
- Snapshot: a photo of the whole server disk at one moment, which you can roll back to if an update breaks something.
- Uptime monitor: a tool that checks on a schedule whether a service still answers, and alerts you when it does not.
What to watch for
- Notice where each copy lives in the 3-2-1 diagram, and why the copy off the server matters most when the server itself fails.
- Watch the retention arithmetic on the board, and check that you can follow how 40 backups become 11 kept and 29 deleted.
- Look at the disk trend chart and find the day the alert fires, and ask why that is earlier than the day the disk fills up.
Learn it with your tutor on the live board
Key points from the video
When the server goes quiet
- AI agents work while you sleep
- The disk filled up overnight
- The last copy is three weeks old
- Almost always preventable
layout: side
direction: LR
components:
cust: {kind: user, label: Customer}
agent: {kind: service, label: AI agents}
db: {kind: database, label: Postgres}
bk: {kind: storage, label: Last backup}
links: [cust->agent, agent->db, db->bk]
steps:
- at: "Picture this"
show: [cust, agent]
note: "A small online shop"
- at: "answer customer messages"
flow: ["cust>agent: message"]
- at: "book appointments"
show: [db]
flow: ["agent>db: booking"]
- at: "send invoices"
note: "Invoices sent"
- at: "server is silent"
highlight: [agent]
note: "No replies"
- at: "disk filled up overnight"
note: "Disk full"
- at: "the database crashed"
highlight: [db]
- at: "forty customer messages"
flow: ["cust>agent: stuck"]
- at: "three weeks ago"
show: [bk]
note: "Three weeks old"
- at: "almost always preventable"
note: "Preventable"
- at: "never happens to your server"
highlight: [db, bk]
note: "Protected" What you will learn
- Back up workflows, data and documents, and prove it
- Update Docker apps without breaking your agents
- Check vital signs and get phone alerts
tree:
This lesson:
Backups: [Workflows, Database, Documents]
Updates: [Docker apps]
Monitoring: [Vital signs, Phone alerts]
direction: down
steps:
- at: "do three things"
grow: This lesson
- at: "automatic backups"
grow: Backups
- at: "update your Docker apps"
grow: Updates
- at: "Third, monitor the server"
grow: Monitoring
- at: "vital signs"
highlight: Vital signs
- at: "an alert on your phone"
highlight: Phone alerts
- at: "routine care"
highlight: This lesson Three habits of a healthy server
- Backups: copies in a safe place
- Updates: a careful routine
- Monitoring: warnings before failures
layout: full
parts:
backups: {chip: Backups, sub: "Copies in a safe place", icon: archive}
updates: {chip: Updates, sub: "A careful routine", icon: wrench}
monitor: {chip: Monitoring, sub: "Warnings first", icon: activity}
server: {box: "Healthy server", holds: [backups, updates, monitor], icon: server}
steps:
- at: "three habits"
zoom_out: server
note: "Three habits"
- at: "On the left are backups"
highlight: backups
- at: "On the right are updates"
highlight: updates
- at: "security holes and bugs"
highlight: updates
note: "Fix holes and bugs"
- at: "monitoring, the heart monitor"
highlight: monitor
- at: "Skip any one of the three"
highlight: none
note: "All three are needed" What to back up, and where
- Database: customers, bookings, chat memory
- n8n: workflows plus its encryption key
- Knowledge base (RAG) documents, .env and docker-compose files
- 3-2-1: three copies, two kinds of storage, one off the server
layout: side
objects:
head: {text: "What to copy", pos: top}
db: {text: "Postgres database", pos: [0, 2.2]}
n8n: {text: "n8n: workflows and key", pos: [0, 1.0]}
docs: {text: "Documents and config", pos: [0, -0.2]}
rule: {text: "The 3-2-1 rule", pos: top}
eq: {tex: '1 + 2 = 3', pos: [0, 1.0]}
eqw: {text: "original + two backups", pos: [0, -0.2]}
kinds: {tex: '2', pos: [-2.2, -1.6], label: "kinds of storage"}
off: {tex: '1', pos: [2.2, -1.6], label: "off the server"}
p1: {text: "Dump the database", pos: [0, 0.5]}
p2: {text: "Compress and encrypt", pos: [0, 0.5]}
p3: {text: "Ship offsite", pos: [0, 0.5]}
p4: {text: "Delete old copies", pos: [0, 0.5]}
steps:
- at: "So what exactly do we copy"
show: head
- at: "The database, here Postgres"
show: db
- at: "n8n holds your workflows"
show: n8n
- at: "Then there are the documents"
show: docs
- at: "three two one rule"
hide: [head, db, n8n, docs]
show: rule
- at: "one original plus two backups"
show: [eq, eqw]
- at: "two different kinds of storage"
show: kinds
- at: "one copy off the server"
show: off
- at: "Every night a scheduled job"
hide: [rule, eq, eqw, kinds, off]
- at: "dumps the database into a single file"
show: p1
- at: "compresses and encrypts it"
morph: [p1, p2]
- at: "ships it offsite"
morph: [p2, p3]
- at: "Old copies are then deleted"
morph: [p3, p4]
- at: "which we look at next"
highlight: p4 Worked example: which backups to keep
- Retention: a rule for how long each copy is kept
# Forty nightly backups, today is Friday 2 October
7 | last seven days, keep every day
4 | Sundays aged 12, 19, 26 and 33 days
7 + 4 = 11 | kept
40 - 11 = 29 | deleted || box:29 A backup only counts once restored
- Restore into a test copy, never over live data
- Compare bookings, customers and newest date
- Repeat monthly and write the steps down
cells:
A1: Check
B1: Live
C1: Restored
D1: Match
A2: Bookings
B2: 48
C2: 48
A3: Customers
B3: 120
C3: 120
A4: Newest record
B4: 412
C4: 412
A5: This week
B5: 17
C5: 17
steps:
- at: "uncomfortable truth"
note: "Restore it to prove it"
- at: "restore it into a separate test database"
select: A1:C5
- at: "check it the way a client would"
select: A2:C5
- at: "booking agent runs appointments"
note: "A hair salon"
- at: "same number of bookings"
type: {D2: '=IF(B2=C2,"Same","Differ")'}
highlight: D2
- at: "this week's appointments"
type: {D5: '=IF(B5=C5,"Same","Differ")'}
highlight: D5
- at: "newest record"
type: {D4: '=IF(B4=C4,"Same","Differ")'}
highlight: D4
- at: "write down the exact steps"
select: D2:D5
- at: "real crash happens"
select: none A safe update routine
- OS security patches: automatic, weekly
- Pin app versions, never "latest"
- Snapshot the whole server disk
- Test a real workflow, keep a way back
layout: full
parts:
snap: {chip: Snapshot, sub: "Whole server disk", icon: camera}
notes: {chip: "Release notes", sub: "Breaking changes", icon: file-text}
one: {chip: "Update one app", sub: "Pinned version", icon: package}
prep: {box: "Prepare and update", holds: [snap, notes, one], icon: list-checks}
check: {chip: "Agents still work?", icon: bot}
done: {chip: Done, sub: "Test message sent", icon: circle-check}
back: {chip: "Roll back", sub: "To the snapshot", icon: undo-2}
result: {box: "Test the result", holds: [done, back], icon: flask-conical}
routine: {box: "Safe update", holds: [prep, check, result], icon: shield-check}
steps:
- at: "Updates are where many self-hosters get burned"
note: "Slow down"
- at: "security patches are low risk"
note: "Automatic and weekly"
- at: "need a routine"
highlight: prep
- at: "First, pin versions"
highlight: one
- at: "take a snapshot"
highlight: snap
- at: "Read the release notes"
highlight: notes
- at: "update one app"
highlight: one
- at: "send a test customer message"
zoom_out: prep
highlight: none
- at: "through your agent"
zoom_out: routine
highlight: check
- at: "anything breaks"
highlight: back
note: "Roll back to the snapshot" Monitoring: watch the trend
- Vital signs: online, disk, memory, CPU
- n8n workflows failing
- Alert before the failure, not after
layout: side
kind: line
title: Disk used, last 7 days
unit: "%"
x: [1, 2, 3, 4, 5, 6, 7]
data: {Disk used: [52, 58, 63, 69, 74, 81, 88]}
steps:
- at: "vital signs"
note: "Online, disk, memory, CPU"
- at: "n8n workflows failing"
note: "Failing workflows"
- at: "seven days of disk usage"
show: all
- at: "fifty-two percent to eighty-eight"
note: "52 to 88 percent"
- at: "Nothing has failed yet"
note: "No failure yet"
- at: "warning line at eighty percent"
line: {y: 80, label: alert 80%}
- at: "alert fires on day six"
note: "Day 6: 81 percent"
- at: "See the pattern"
note: "The trend"
- at: "before the failure"
note: "Act before the failure" Alerts with Uptime Kuma
- Free tool, one-click install
- Checks n8n, webhook and SSL certificate
- Alerts on Telegram or email
- Add an outside watcher
layout: side
direction: LR
components:
kuma: {kind: service, label: Uptime Kuma}
n8n: {kind: service, label: n8n}
hook: {kind: api, label: Webhook URL}
tg: {kind: external, label: Telegram}
out: {kind: external, label: Outside check}
links: [kuma->n8n, kuma->hook, kuma->tg, out->n8n]
steps:
- at: "don't need to build anything"
show: [kuma]
note: "Nothing to build"
- at: "Uptime Kuma is a free tool"
highlight: [kuma]
note: "Free, one click"
- at: "checks your n8n address"
show: [n8n]
flow: ["kuma>n8n: visit"]
- at: "the webhook your booking form calls"
show: [hook]
flow: ["kuma>hook: visit"]
- at: "warns you before your SSL certificate expires"
note: "SSL warning"
- at: "sends alerts on Telegram or by email"
show: [tg]
flow: ["kuma>tg: alert"]
- at: "that server dies"
note: "Same server, same fate"
- at: "add one outside watcher"
show: [out]
flow: ["out>n8n: check"]
- at: "so someone outside is watching"
highlight: [out]
note: "Someone watches the watcher" Common mistake: backups on the same server
- Backups sit on the same disk as live data
- One failure or break-in deletes both
- Fix: encrypted copy offsite, automatically
layout: side
direction: LR
components:
live: {kind: database, label: Live data}
bk: {kind: storage, label: Backup}
remote: {kind: bucket, label: Offsite bucket}
zones:
- {label: Same server, contains: [live, bk]}
links: [live->bk, bk->remote]
steps:
- at: "keeping backups on the same server"
show: [live, bk]
- at: "the files are right there"
highlight: [bk]
note: "Feels safe"
- at: "deletes everything"
highlight: [live, bk]
note: "Both gone"
- at: "spare house key"
note: "Key inside the house"
- at: "copied automatically to separate storage"
show: [remote]
flow: ["bk>remote: copy"]
- at: "protects every client you serve"
highlight: [remote]
note: "Once, for every client" Recap
- Back up nightly, offsite, and test a restore monthly
- Update with pinned versions, snapshots and a test
- Monitor vital signs and alert on trends
layout: side
objects:
head: {text: "Three takeaways", pos: top}
back: {text: "1. Back up", pos: [0, 2.0]}
upd: {text: "2. Update", pos: [0, 0.8]}
mon: {text: "3. Monitor", pos: [0, -0.4]}
pct: {tex: '80\%', pos: [0, -2.0], label: "disk alert"}
steps:
- at: "wrap up with three takeaways"
show: head
- at: "First, back up the database"
show: back
- at: "Second, update with a routine"
show: upd
- at: "Third, monitor the vital signs"
show: mon
- at: "disk usage crossing eighty percent"
show: pct
- at: "confidently sell to clients"
highlight: pct
note: "Ready to sell" Exercise: give your server a health routine
- Schedule a nightly database dump, copied offsite
- Restore it to a test database, compare row counts
- Install Uptime Kuma, alert to Telegram or email
- Stop n8n for a minute and watch the alert arrive
layout: side
direction: LR
components:
job: {kind: function, label: Nightly job}
db: {kind: database, label: Postgres}
store: {kind: bucket, label: Offsite copy}
test: {kind: database, label: Test database}
n8n: {kind: service, label: n8n}
kuma: {kind: service, label: Uptime Kuma}
tg: {kind: external, label: Telegram}
links: [job->db, db->store, store->test, kuma->n8n, kuma->tg]
steps:
- at: "give your own server a health routine"
show: [job]
- at: "dumps your database"
show: [db]
flow: ["job>db: dump"]
- at: "copies it to storage outside the server"
show: [store]
flow: ["db>store: copy"]
- at: "restore last night's file"
show: [test]
flow: ["store>test: restore"]
- at: "compare the number of rows"
note: "Same row counts"
- at: "install Uptime Kuma"
show: [kuma, n8n]
- at: "a check for your n8n address"
flow: ["kuma>n8n: check"]
- at: "connect an alert to Telegram"
show: [tg]
flow: ["kuma>tg: alert"]
- at: "Stop the n8n container"
highlight: [n8n]
note: "Stopped for a minute"
- at: "watch the alert arrive"
highlight: [tg]
note: "Alert arrives"
- at: "reusable AI OS blueprint"
note: "Next lesson" Transcript
When the server goes quiet. Picture this. You run a small online shop, and your AI agents on a private server answer customer messages, book appointments and send invoices while you sleep. One Monday morning the server is silent. The disk filled up overnight, the database crashed, and forty customer messages are stuck in the queue with nobody answering. Worse, the last copy of your bookings is from three weeks ago. This happens to real businesses every month, and it's almost always preventable. Today we make sure it never happens to your server, or to the servers you set up for your clients.
What you will learn. By the end of this lesson you'll be able to do three things. First, set up automatic backups of your n8n workflows, your database and your documents, and prove they work by restoring one. Second, update your Docker apps safely, so a new version never takes your agents down by surprise. Third, monitor the server. That simply means watching a few vital signs, like whether it's online and how full the disk is, and getting an alert on your phone before a small problem becomes an outage. Think of it as routine care for the machine your business runs on.
Three habits of a healthy server. Keeping a server healthy comes down to three habits, a bit like caring for a car. On the left are backups, the safe where copies of your data live, so a crash costs you an hour instead of your customer list. On the right are updates, the toolbox. New versions fix security holes and bugs, but they need a careful routine. And above the server is monitoring, the heart monitor that tells you something's wrong before your customers notice. Skip any one of the three, and the other two can't save you.
What to back up, and where. So what exactly do we copy? The database, here Postgres, holds your customers, your bookings and the conversation memory from lesson four. n8n holds your workflows and its encryption key, without which saved credentials can't be read. Then there are the documents behind your knowledge base, plus the dot env file and the docker compose file. A good guide is the three two one rule: one original plus two backups gives three copies, on two different kinds of storage, with one copy off the server. Each night, after the copies are made, a scheduled job takes over. It dumps the database into a single file, compresses and encrypts it, then ships it offsite. Old copies are then deleted, which we look at next.
Worked example: which backups to keep. Nightly backups pile up fast, so you need a retention policy, which is just a rule for how long each copy is kept. Think of a shop keeping daily receipts for a week and weekly summaries for a month. Let's apply that rule to forty nightly backups, with today being Friday the second of October. From the last seven days, we keep every day: that's seven copies. Older than that, we keep only the Sundays, aged twelve, nineteen, twenty-six and thirty-three days. Those are Sunday copies up to about five weeks old, which here is four of them. Seven plus four gives eleven kept. And forty minus eleven gives twenty-nine deleted. The oldest copy we keep is from the thirtieth of August. You get a week of fine detail and a month of history, without filling the disk.
A backup only counts once restored. Here's the uncomfortable truth: a backup you've never restored is only a hope. Once a month, take last night's backup file and restore it into a separate test database, never over the live one. Then check it the way a client would. Say your booking agent runs appointments for a hair salon. Does the restored copy have the same number of bookings as the live one? Are this week's appointments there? Is the newest record from last night? If the numbers match, write down the exact steps you used. Now, when a real crash happens, restoring is a calm ten-minute job instead of a panic.
A safe update routine. Updates are where many self-hosters get burned, so let's slow down. Operating system security patches are low risk, so let them install automatically every week. App updates, like n8n or your database, need a routine. First, pin versions: in your docker compose file, write a fixed version number instead of the word latest, so nothing changes behind your back. Before updating, take a snapshot, a photo of the whole server disk that most VPS panels offer in one click. Read the release notes for breaking changes, update one app, then send a test customer message through your agent. If anything breaks, roll back to the snapshot.
Monitoring: watch the trend. Monitoring means watching a few vital signs: is the server online, how full is the disk, how much memory is in use, how busy the processor, or CPU, is, and are n8n workflows failing. Here are seven days of disk usage on a client's server. It climbs from fifty-two percent to eighty-eight, because chat logs and backups pile up. Nothing has failed yet, and that's exactly the point. We draw a warning line at eighty percent, and the alert fires on day six, giving you days to clean up instead of minutes. See the pattern? Alert on the trend, before the failure, not after it.
Alerts with Uptime Kuma. For the online side, you don't need to build anything. Uptime Kuma is a free tool you install with one click from the Docker panel you met in lesson three. Every minute it checks your n8n address and the webhook your booking form calls, and it warns you before your SSL certificate expires. If something stops answering, it sends alerts on Telegram or by email. One catch: if it lives on the same server and that server dies, it goes quiet too. So also add one outside watcher, so someone outside is watching the watcher.
Common mistake: backups on the same server. The most common mistake is keeping backups on the same server as the live data. It feels safe, because the files are right there and restoring would be quick. But if the disk fails, your provider has an outage, or someone breaks in and deletes everything, the backup goes down with the server. It's like keeping your spare house key inside the house. The fix is simple: every nightly backup is encrypted and copied automatically to separate storage, such as a storage bucket with another provider. Set it up once, and it protects every client you serve.
Recap. Let's wrap up with three takeaways. First, back up the database, n8n with its encryption key, your documents and your config files every night, keep copies off the server, and prove them with a monthly restore. Second, update with a routine: pinned versions, a snapshot first, one app at a time, and a real test message afterwards. Third, monitor the vital signs and alert on trends, like disk usage crossing eighty percent, using a tool like Uptime Kuma plus an outside check. Do these three, and your server becomes something you can confidently sell to clients.
Exercise: give your server a health routine. Your task before the next lesson is to give your own server a health routine. Set up a nightly n8n workflow, or a cron job, which is the server's built-in scheduler, that dumps your database and copies it to storage outside the server. Then restore last night's file into a test database and compare the number of rows in one table, say customers, with the live one. Finally, install Uptime Kuma, add a check for your n8n address, and connect an alert to Telegram or email. Stop the n8n container for a minute and watch the alert arrive. Next lesson, all of this becomes part of your reusable AI OS blueprint.
Explore the animations
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...
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...
Answer every question, then check. 70% passes; you can retry as often as you like.
Lesson summary
- Reading
- Video watched
- Quiz passed (70%)
- Back up nightly, offsite, and test a restore monthly
- Update with pinned versions, snapshots and a test
- Monitor vital signs and alert on trends