You inherit a fleet of Linux servers with no documentation, or you've built an environment that only you understand. When something breaks at 3am or you're on vacation, the team is stuck guessing which server runs what, where the backups live, and why port 8080 is open. Good documentation isn't optional; it's part of the infrastructure. A linux administrator guide that covers inventory, configurations, network rules, and procedures turns tribal knowledge into a resource the whole team can use.
This article gives you a complete template for documenting a production Linux environment. Each section shows what to include, the format to use, and real examples of the details that matter. Copy the structure, fill in your specifics, commit it to Git, and you'll have a reference that survives server failures and staff turnover.
Infrastructure Inventory: What You're Running
Start with a table of every server and VM: hostname, IP address, OS and version, role, owner or team, location (datacenter, cloud region, rack), and specs. Keep this in Markdown, CSV, or a wiki that lives outside your infrastructure. If your GitLab server dies, you need to know where it was running and how to rebuild it.
Server and VM inventory table format
Use a simple table with columns you can sort and search. Here's the format:
| Hostname | IP | OS | Role | Owner | Location | CPU | RAM | Disk |
|-------------------|--------------|-----------------|-------------|---------|------------|-----|------|-----------|
| web01.example.com | 10.0.1.10 | Ubuntu 24.04 | Web server | Platform| us-east-1a | 4 | 16GB | 100GB SSD |
| db01.example.com | 10.0.2.5 | Debian 12 | PostgreSQL | Platform| us-east-1b | 8 | 32GB | 500GB SSD |
| app01.example.com | 10.0.1.20 | RHEL 9.3 | App server | Backend | us-east-1a | 8 | 16GB | 200GB SSD |
Add a last-updated date at the top of the file. Update this table whenever you provision or decommission a host. For physical servers, include the asset tag and IPMI address.
Network device and topology documentation
Document subnets, VLANs, gateways, and switches. A simple text diagram works:
10.0.1.0/24 (DMZ, VLAN 10)
Gateway: 10.0.1.1 (fw01)
Hosts: web01, web02, lb01
10.0.2.0/24 (Database, VLAN 20)
Gateway: 10.0.2.1 (fw01)
Hosts: db01, db02
10.0.3.0/24 (Management, VLAN 30)
Gateway: 10.0.3.1
IPMI/iLO addresses for physical hosts
Include firewall rules between VLANs in summary form here; the full ruleset goes in the next section. List any external IPs, load balancers, and NAT mappings. If you're in AWS or GCP, note VPC IDs, security group names, and peering connections.
Service and application registry
For every service, record what it does, where it runs, which ports it listens on, dependencies, the version, and config paths. This answers "what breaks if db01 goes down?" without logging in:
nginx (web01.example.com)
Version: 1.30.2
Listens: :80, :443
Proxies to: app01.example.com:8080
Config: /etc/nginx/sites-enabled/example.conf
SSL cert: /etc/nginx/ssl/example.com.crt (expires 2026-08-15)
Depends on: app01 availability
PostgreSQL (db01.example.com)
Version: 16.2
Listens: :5432 (10.0.2.0/24 only)
Data: /var/lib/postgresql/16/main
Config: /etc/postgresql/16/main/postgresql.conf
Clients: app01, app02
Replication: streaming to db02 (standby)
Store this in the same repository as your inventory. When you upgrade a service or change a port, update this file in the same commit. For a more structured approach, the Linux System Administration Handbook covers tooling for tracking service dependencies across larger fleets.
Configuration Baselines and Standards
Document the baseline configuration every server should have. This is your checklist for new hosts and the standard you audit against. It prevents configuration drift and makes it clear when a server is non-compliant.
OS hardening checklist
List the security and operational settings you apply to every host:
- SELinux enforcing (RHEL/CentOS) or AppArmor enforcing (Debian/Ubuntu)
- SSH: key-based auth only, PermitRootLogin no, Port 22
- fail2ban enabled with default jails
- unattended-upgrades or dnf-automatic for security patches
- Timezone: UTC
- NTP: chrony syncing to pool.ntp.org
- Firewall: default deny inbound, allow established/related
- Logging: rsyslog forwarding to log01.example.com:514
- User accounts: individual accounts, no shared logins
- sudo: per-user or group-based, logged
For SSH, link to the sshd_config man page and note any deviations from these defaults. If you disable PasswordAuthentication, say so explicitly. For hardening beyond the basics, see the Linux Server Hardening Complete Guide.
Service configuration templates
Keep a reference copy of each service's config with comments explaining non-default settings. If you manage configs with Ansible, link to the role or template. Otherwise, store a commented file:
# /etc/nginx/conf.d/example.conf (reference)
server {
listen 80;
server_name example.com;
return 301 https://$server_name$request_uri; # Force HTTPS
}
server {
listen 443 ssl http2;
server_name example.com;
ssl_certificate /etc/nginx/ssl/example.com.crt;
ssl_certificate_key /etc/nginx/ssl/example.com.key;
ssl_protocols TLSv1.2 TLSv1.3; # No TLS 1.0/1.1
location / {
proxy_pass http://10.0.1.20:8080; # app01
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}
For complex services like PostgreSQL, link to your tuned postgresql.conf or the relevant section of the official documentation explaining your settings.
Package and repository policy
Document which repositories you trust and your update policy. This prevents someone from adding a random PPA or third-party repo that breaks dependencies:
Debian/Ubuntu:
- Main archive: archive.ubuntu.com (or internal mirror)
- Enabled: main, restricted, universe, multiverse
- security updates: automatic via unattended-upgrades
- File: /etc/apt/sources.list.d/ubuntu.sources
RHEL/Rocky:
- Base, AppStream, EPEL enabled
- EPEL: /etc/yum.repos.d/epel.repo
- exclude: postgresql* (we use upstream RPMs)
- dnf-automatic enabled for security updates only
Policy:
- No major version upgrades without testing (PostgreSQL 15 โ 16, nginx 1.30 โ 1.32)
- Pin critical packages if needed (apt preferences, yum versionlock)
- New repos require approval and GPG key verification
If you run your own package mirror or repository, document the sync schedule and the upstream source.
Network and Firewall Rules Reference
List every firewall rule with source, destination, port, protocol, and why it exists. When someone asks "why is port 8080 open?" or "can I reach the database from this host?" this section answers it without trial and error.
Firewall rule documentation format
Show the rules in a table or annotated iptables-save output. For iptables, you can dump the current ruleset with comments:
# Allow established connections
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
# SSH from management network only
-A INPUT -p tcp -s 10.0.3.0/24 --dport 22 -j ACCEPT
# HTTP/HTTPS from anywhere (web servers)
-A INPUT -p tcp --dport 80 -j ACCEPT
-A INPUT -p tcp --dport 443 -j ACCEPT
# PostgreSQL from app servers only
-A INPUT -p tcp -s 10.0.1.0/24 --dport 5432 -j ACCEPT
# Default deny
-A INPUT -j DROP
Or use a table:
| Source | Destination | Port | Proto | Purpose |
|---------------|--------------|------|-------|--------------------------|
| 10.0.3.0/24 | any | 22 | tcp | SSH from management VLAN |
| 10.0.1.0/24 | 10.0.2.5 | 5432 | tcp | App servers to PostgreSQL|
| any | 10.0.1.10 | 443 | tcp | Public HTTPS to web01 |
| 10.0.2.5 | 10.0.2.6 | 5432 | tcp | PostgreSQL replication |
For nftables, use nft list ruleset with comments. For cloud firewalls (AWS security groups, GCP firewall rules), export the rules as JSON or note the resource IDs and inbound/outbound rules. The iptables man page covers the match syntax if you need to decode complex rules.
VPN and remote access setup
Document VPN configuration: WireGuard or OpenVPN, server address, port, client config location, and peer public keys. For WireGuard:
WireGuard server: vpn.example.com:51820
Config: /etc/wireguard/wg0.conf
Server public key: abc123...
Allowed IPs: 10.0.0.0/8 (internal networks)
Clients:
- admin-laptop: peer public key def456..., allowed IP 10.100.0.2/32
- oncall-phone: peer public key ghi789..., allowed IP 10.100.0.3/32
For OpenVPN, note the CA certificate location, client .ovpn file template, and any pushed routes or DNS servers. Include the process for adding or revoking a user.
DNS and routing notes
List authoritative zones, forwarders, and any split-horizon DNS. If you run BIND or dnsmasq, note the config path and zone files:
Internal DNS: 10.0.3.10 (ns01.example.com)
Zones: example.com (internal view), 10.0.in-addr.arpa
Config: /etc/bind/named.conf.local
Forwarders: 1.1.1.1, 8.8.8.8
Split-horizon:
- example.com external: 203.0.113.10 (public web)
- example.com internal: 10.0.1.10 (web01)
Document any static routes: if your app servers need to reach a partner network via a specific gateway, note the route and why it exists. Use ip route show output with comments.
Backup and Disaster Recovery Procedures
Document every backup: what you're backing up, the tool, schedule, retention policy, and where the backups live. When a disk fails or a server burns down, this section tells you exactly how to restore. Include the commands to run, not just the tool name.
Backup schedule and retention
List each backup job with the source, destination, schedule, and retention. Use a table:
| Source | Tool | Schedule | Retention | Destination |
|-------------------------|--------|------------------|------------------------|---------------------------------|
| PostgreSQL (db01) | pg_dump| Daily 02:00 UTC | 7 daily, 4 weekly, 12m | s3://backups/db01/ |
| /etc (all hosts) | restic | Daily 03:00 UTC | 7 daily, 4 weekly | s3://backups/etc/ |
| /home (all hosts) | restic | Daily 03:30 UTC | 7 daily, 4 weekly | s3://backups/home/ |
| App data (/var/app) | restic | Daily 04:00 UTC | 7 daily, 4 weekly, 6m | nas01:/mnt/backups/app/ |
| nginx configs | git | On change | Full history | gitlab.example.com:ops/configs |
For PostgreSQL, the backup command might be:
pg_dumpall -U postgres | gzip > /backup/db01-$(date +%Y%m%d).sql.gz
For restic, the cron job on each host runs:
restic -r s3:s3.amazonaws.com/backups/etc backup /etc --exclude /etc/mtab
restic -r s3:s3.amazonaws.com/backups/etc forget --keep-daily 7 --keep-weekly 4 --prune
Store credentials in /root/.restic_password or environment variables, not in the script. Document where the S3 access keys or NAS credentials live (password manager, vault).
Restore procedures with commands
Show the exact commands to restore from each backup type. For restic:
# List snapshots
restic -r s3:s3.amazonaws.com/backups/etc snapshots
# Restore latest snapshot to /restore
restic -r s3:s3.amazonaws.com/backups/etc restore latest --target /restore
# Restore specific snapshot
restic -r s3:s3.amazonaws.com/backups/etc restore abc123de --target /restore
# Restore single file
restic -r s3:s3.amazonaws.com/backups/etc restore latest --target /tmp --include /etc/nginx/nginx.conf
For PostgreSQL:
# Restore full dump
gunzip < db01-20260315.sql.gz | psql -U postgres
# Restore single database
pg_restore -U postgres -d myapp /backup/myapp-20260315.dump
Test restores monthly. Pick a random snapshot, restore it to a test VM, and verify the data. Document the last successful restore test date and any issues found.
Disaster recovery runbook
Write step-by-step instructions to rebuild each critical service from zero. If db01 dies completely, here's the procedure:
1. Provision new VM: 8 CPU, 32GB RAM, 500GB SSD, Ubuntu 24.04
Hostname: db01.example.com
IP: 10.0.2.5 (same as old host)
2. Install PostgreSQL 16:
apt update && apt install -y postgresql-16
3. Stop PostgreSQL:
systemctl stop postgresql
4. Restore data from restic:
restic -r s3:s3.amazonaws.com/backups/db01 restore latest --target /
chown -R postgres:postgres /var/lib/postgresql
5. Restore latest SQL dump:
gunzip < /backup/db01-20260315.sql.gz | sudo -u postgres psql
6. Start PostgreSQL:
systemctl start postgresql
7. Verify replication to db02 (standby):
sudo -u postgres psql -c "SELECT * FROM pg_stat_replication;"
8. Update DNS if IP changed (unlikely):
Update A record for db01.example.com
9. Test app connectivity:
From app01: psql -h db01.example.com -U appuser -d myapp -c "SELECT 1;"
10. Monitor for 24 hours, check logs for errors
Include estimated RTO (recovery time objective) and RPO (recovery point objective). For this setup, RTO is about 2 hours (provision VM, restore, verify), RPO is 24 hours (daily backups). If you need better RPO, switch to continuous WAL archiving or streaming replication with point-in-time recovery.
Monitoring and Alerting Setup
Document what you monitor, the thresholds that trigger alerts, who gets notified, and how to access dashboards. When an alert fires at 3am, this section tells the on-call engineer whether it's urgent and what to check first. For more on choosing and deploying monitoring tools, see Linux Server Monitoring Essentials.
What you monitor and thresholds
List every metric and the threshold that triggers an alert:
System metrics (all hosts):
- CPU usage >80% for 5 minutes โ warning
- Disk usage >90% โ critical
- Memory available <500MB โ warning
- Load average > CPU count * 2 for 10 minutes โ warning
- Systemd service down (nginx, postgresql, app) โ critical
Service-specific:
- PostgreSQL connections >90% of max_connections โ warning
- PostgreSQL replication lag >10MB โ warning, >100MB โ critical
- nginx 5xx errors >10/min โ warning
- SSL certificate expiry <30 days โ warning, <7 days โ critical
- Failed SSH logins >10/min from single IP โ warning
Application:
- HTTP health check (https://example.com/health) fails โ critical
- API response time p95 >500ms โ warning
For each metric, note the data source: node_exporter for system metrics, postgres_exporter for database metrics, nginx logs parsed by promtail, or custom scripts.
Alert routing and escalation
Document who gets notified for each alert severity and how. For Alertmanager with Prometheus:
# /etc/prometheus/alertmanager.yml
route:
receiver: 'ops-email'
group_by: ['alertname', 'instance']
group_wait: 30s
group_interval: 5m
repeat_interval: 4h
routes:
- match:
severity: critical
receiver: 'pagerduty-ops'
- match:
severity: warning
receiver: 'ops-email'
receivers:
- name: 'ops-email'
email_configs:
- to: 'ops@example.com'
- name: 'pagerduty-ops'
pagerduty_configs:
- service_key: 'abc123...'
For maintenance windows, silence alerts with:
amtool silence add alertname="DiskUsage" instance="web01.example.com" --duration 2h --comment "Clearing logs"
If you use Zabbix, document the action commands, trigger severity levels, and user groups. Include the URL to the web interface and the credentials location.
Dashboard and query examples
Link to Grafana dashboards by URL or store the JSON in Git. List key queries for troubleshooting:
Prometheus queries:
- Hosts down: up{job="node"} == 0
- Disk usage: (node_filesystem_size_bytes - node_filesystem_free_bytes) / node_filesystem_size_bytes * 100
- PostgreSQL connections: pg_stat_database_numbackends{datname="myapp"}
- nginx request rate: rate(nginx_http_requests_total[5m])
- SSL cert expiry days: (ssl_cert_not_after - time()) / 86400
For Grafana, note the dashboard IDs or names:
Dashboards:
- Node Exporter Full: https://grafana.example.com/d/node-exporter-full
- PostgreSQL Overview: https://grafana.example.com/d/postgres-overview
- nginx Metrics: https://grafana.example.com/d/nginx-metrics
Include the Prometheus URL (http://prometheus.example.com:9090) and any authentication details. If you export dashboards as JSON, commit them to the same repository as this documentation.
Service-Specific Runbooks
Each critical service needs its own runbook: how to restart it safely, common errors and fixes, maintenance tasks, and deployment procedures. These are the instructions you follow during an incident or hand to a junior admin.
Web server operations
For nginx, document the reload vs. restart distinction and how to test configs before applying them:
# Test config syntax
nginx -t
# Reload (zero downtime, keeps connections open)
systemctl reload nginx
# Restart (drops connections, use only if reload fails)
systemctl restart nginx
# Check status and recent logs
systemctl status nginx
journalctl -u nginx -n 50 --no-pager
Log rotation is handled by logrotate. The config in /etc/logrotate.d/nginx rotates daily, keeps 14 days, compresses old logs, and runs nginx -s reopen after rotation. If logs aren't rotating, check /var/lib/logrotate/status for the last run time.
Certificate renewal with certbot is automated via cron or systemd timer. To renew manually:
certbot renew --nginx
systemctl reload nginx
Common errors: Permission denied on /var/www/html means wrong ownership, fix with chown -R www-data:www-data /var/www/html. A 502 Bad Gateway means the upstream (app server) is down or unreachable; check proxy_pass in the config and verify the app is listening on the expected port with ss -tlnp | grep 8080. For more nginx configuration details, see the nginx documentation.
Database maintenance tasks
For PostgreSQL, document backups, vacuum, connection tuning, and replication checks:
# Full backup (all databases)
pg_dumpall -U postgres | gzip > /backup/db01-$(date +%Y%m%d).sql.gz
# Single database backup
pg_dump -U postgres -Fc myapp > /backup/myapp-$(date +%Y%m%d).dump
# Manual vacuum (usually autovacuum handles this)
vacuumdb -U postgres --all --analyze
# Check replication lag (on standby)
sudo -u postgres psql -c "SELECT pg_last_wal_replay_lsn();"
# Check active connections
sudo -u postgres psql -c "SELECT count(*) FROM pg_stat_activity;"
Connection pooling with pgbouncer is in /etc/pgbouncer/pgbouncer.ini. Key settings: max_client_conn = 200, default_pool_size = 25, pool_mode = transaction. If clients get "connection limit exceeded", check SHOW POOLS; in the pgbouncer admin console and increase max_client_conn if needed. Restart pgbouncer with systemctl restart pgbouncer.
For replication, monitor lag with the query above. If lag exceeds 100MB, check network connectivity between primary and standby, and look for long-running queries on the primary blocking WAL shipping. The PostgreSQL documentation covers replication troubleshooting in detail.
Application deployment steps
For a Python application running under systemd, document the deploy and rollback process:
# Deploy new version
cd /opt/myapp
git fetch origin
git checkout v2.3.0 # or specific commit
pip install -r requirements.txt --upgrade
python manage.py migrate # if Django
systemctl restart myapp.service
# Verify deployment
curl http://localhost:8000/health
journalctl -u myapp.service -n 20 --no-pager
# Rollback to previous version
git checkout v2.2.9
pip install -r requirements.txt
systemctl restart myapp.service
The health check endpoint should return JSON with status and version:
$ curl localhost:8000/health
{"status": "ok", "version": "2.3.0", "db": "connected"}
If the health check fails, check logs with journalctl -u myapp.service -f. Common issues: database connection failure (check DATABASE_URL in /etc/myapp/config.env), missing Python dependencies (re-run pip install), or port conflict (another process on 8000, check with ss -tlnp | grep 8000).
For systemd service management, the unit file is in /etc/systemd/system/myapp.service. After editing it, run systemctl daemon-reload and systemctl restart myapp.service. To enable automatic start on boot, use systemctl enable myapp.service.
Incident Response and Troubleshooting Guide
Document every significant incident after you resolve it. Future incidents often follow the same pattern, and a searchable history of failures and fixes saves hours of re-investigation. Record the symptom, the commands you ran to diagnose it, the root cause, and the fix. This section becomes your team's institutional memory.
Common failure modes and fixes
Keep a list of past incidents with enough detail to reproduce the diagnosis. For a disk-full incident on web01:
Symptom: nginx returns 500 errors, systemd logs "Failed to write log"
Diagnosis:
df -h # / at 100%
du -sh /var/log/* # /var/log/nginx/access.log is 45GB
Fix:
truncate -s 0 /var/log/nginx/access.log
systemctl reload nginx
# Adjust /etc/logrotate.d/nginx to rotate daily instead of weekly
Root cause: logrotate config had rotate 52 (weekly for a year), access log grew unchecked
Prevention: Changed to rotate 14, daily, and added size 100M maxsize directive
For PostgreSQL replication lag:
Symptom: Standby db02 lagging 500MB behind primary db01
Diagnosis:
sudo -u postgres psql -c "SELECT pg_wal_lsn_diff(pg_current_wal_lsn(), replay_lsn) FROM pg_stat_replication;"
# Network between db01 and db02 saturated, iperf3 shows 100Mbps instead of 1Gbps
ethtool eth0 # Speed: 100Mb/s (should be 1000Mb/s)
Fix:
# Cable issue, replaced network cable, speed restored to 1Gbps
# Lag cleared in 10 minutes
Root cause: Faulty network cable auto-negotiated to 100Mbps
For slow SSH logins, the fix is usually DNS timeout. Symptom: ssh user@web01 hangs for 30 seconds before prompting for password. Diagnosis: ssh -v user@web01 shows delay after "Connecting to web01". Fix: add UseDNS no to /etc/ssh/sshd_config and systemctl restart sshd. Root cause: sshd tries reverse DNS lookup on client IP, times out if DNS is slow or unavailable. See the sshd_config man page for other performance-related options.
Escalation matrix
Define who owns each layer of the stack and how to reach them. When you're stuck, you need to know who to call without guessing:
| Issue | Owner | Contact | Hours |
|---------------------------|---------------|---------------------------------|---------------|
| Firewall rules, VPN | Network team | #network on Slack, +1-555-0100 | 24/7 |
| Database queries, tuning | DBA team | #database on Slack, page via PD | 24/7 |
| Application bugs | Dev team | #backend on Slack | Mon-Fri 9-5 |
| SAN, storage | Vendor (NetApp)| support@netapp.com, case portal| 24/7 (paid) |
| Cloud infra (AWS) | Platform team | #platform on Slack, page via PD | 24/7 |
| Physical servers, IPMI | Datacenter | +1-555-0200, ticket portal | 24/7 |
For critical issues, escalate immediately. A database deadlock you can't resolve in 15 minutes goes to the DBA team. A firewall rule blocking production traffic goes to the network team right away. For non-urgent issues, open a ticket and follow up in the team's Slack channel.
Post-incident checklist
After every incident, run through this checklist within 48 hours:
1. Update this troubleshooting guide with the symptom, diagnosis, and fix
2. Write a postmortem (template below)
3. Test the fix in staging if possible
4. Schedule any preventive work (update configs, add monitoring, patch software)
5. Review monitoring: should this incident have alerted sooner?
6. Share the postmortem with the team (Slack, email, wiki)
A postmortem is a blameless record of what happened. Keep it factual and focus on the timeline, root cause, and action items:
Incident: web01 disk full, nginx 500 errors
Date: 2026-03-15 14:30 UTC
Duration: 45 minutes (14:30-15:15 UTC)
Impact: example.com returned 500 errors to all users
Timeline:
14:30 - Alert: nginx 5xx errors >10/min
14:32 - On-call checked logs, found "No space left on device"
14:35 - Identified /var/log/nginx/access.log at 45GB
14:40 - Truncated access.log, reloaded nginx
14:45 - Errors stopped, site recovered
15:15 - Updated logrotate config, tested rotation
Root cause: logrotate configured to keep 52 weeks of logs, access log grew to 45GB
Action items:
- [DONE] Changed logrotate to keep 14 days, added maxsize 100M
- [TODO] Add disk usage alert for /var/log specifically (currently only / is monitored)
- [TODO] Review logrotate configs on all web servers (web02, web03)
Keep postmortems in the same repository as this documentation or in a shared wiki. They're valuable for onboarding and for spotting patterns across incidents.
Change Management and Maintenance Windows
Define your change process so the team knows when they can make changes, what testing is required, and how to roll back if something breaks. Ad-hoc changes cause outages; a documented process with approval and testing catches problems before they hit production.
Distinguish between standard changes (low-risk, pre-approved) and normal changes (require review). Standard changes include: applying security patches via unattended-upgrades, restarting a service after a config tweak you've tested in staging, renewing SSL certificates with certbot. Normal changes include: kernel upgrades, PostgreSQL major version upgrades, firewall rule changes, adding a new service. Emergency changes (fixing an active outage) skip the approval step but still require documentation and a rollback plan.
For every change, test in staging first. If you don't have staging, test on a non-production host or in a VM. A kernel upgrade that works on your laptop might break a production server with different hardware or a custom module. Document the test: what you ran, what you checked, and the result.
Approval depends on your team size. For a small team, an email to ops@example.com or a message in Slack with 24 hours' notice is enough. For larger teams, use a ticketing system (Jira, GitLab issues) with a change request template. Always have a rollback plan: for a package upgrade, note the current version and the apt install package=version or yum downgrade package command to revert. For a config change, keep the old file as config.old or commit both versions to Git.
Maintenance window schedule and announcements
Define regular maintenance windows when you can reboot servers or make disruptive changes. For most teams, Sunday 02:00-04:00 UTC works well. Document the window, how to announce changes, and what to test after:
Maintenance window: Sunday 02:00-04:00 UTC (Saturday 9pm-11pm EST)
Announce: Email ops-announce@example.com 48 hours in advance, update status.example.com
Allowed: Reboots, service restarts, kernel upgrades, package updates
Post-maintenance checklist:
- Ping all hosts: fping -g 10.0.0.0/16
- Check dashboards: Grafana shows all services up
- Test SSH login to each host
- Verify app health: curl https://example.com/health
- Check logs for errors: journalctl --since "2 hours ago" -p err
For emergency maintenance outside the window, send an immediate notification and follow up with a postmortem. If you manage a status page, update it before starting work and again when maintenance is complete.
Sample change request template
Use a standard template for change requests. This ensures you think through the risk and rollback before making the change:
Change Request: Upgrade PostgreSQL 15 to 16 on db01
Summary: Upgrade PostgreSQL to version 16 for performance improvements and new features
Risk: Medium (database downtime, potential compatibility issues)
Scheduled: 2026-03-24 02:00 UTC (maintenance window)
Duration: 2 hours (estimated)
Steps:
1. Announce maintenance 48h in advance
2. Take full backup: pg_dumpall > /backup/db01-pre-upgrade.sql
3. Stop application (systemctl stop myapp)
4. Stop PostgreSQL 15 (systemctl stop postgresql@15-main)
5. Install PostgreSQL 16: apt install postgresql-16
6. Run pg_upgrade:
sudo -u postgres /usr/lib/postgresql/16/bin/pg_upgrade \
--old-datadir=/var/lib/postgresql/15/main \
--new-datadir=/var/lib/postgresql/16/main \
--old-bindir=/usr/lib/postgresql/15/bin \
--new-bindir=/usr/lib/postgresql/16/bin
7. Start PostgreSQL 16 (systemctl start postgresql@16-main)
8. Run analyze: vacuumdb --all --analyze-in-stages
9. Start application (systemctl start myapp)
10. Test app functionality, check logs
Rollback plan:
1. Stop PostgreSQL 16 (systemctl stop postgresql@16-main)
2. Start PostgreSQL 15 (systemctl start postgresql@15-main)
3. Restore from backup if data corruption: psql < /backup/db01-pre-upgrade.sql
4. Start application (systemctl start myapp)
Testing:
- Tested pg_upgrade on staging db (db-staging.example.com) on 2026-03-17
- Verified app compatibility with PostgreSQL 16 in dev environment
- Reviewed PostgreSQL 16 release notes for breaking changes
Approval: Pending (DevOps lead)
Adapt this template to your environment. For smaller changes, simplify it. The key elements are: what you're changing, the risk, the steps, and how to roll back. Store change requests in a ticket system or as files in Git with a naming convention like changes/2026-03-24-postgres-upgrade.md.
Keeping Documentation Current: A Checklist
Documentation decays the moment you write it. Every server you provision, every config you change, every incident you resolve makes part of this document outdated. Keeping it current requires discipline and a process. Here's a checklist to prevent your linux administrator guide from becoming a historical artifact:
- Update inventory immediately: When you provision or decommission a host, update the server table before you move to the next task. Make it part of your deployment script or Ansible playbook.
- Commit config changes to Git: Store reference configs (
/etc/nginx,/etc/postgresql, firewall rules) in a repository. When you change a config in production, commit the new version with a meaningful message. This keeps the documentation in sync and gives you history. - Document during incidents, not after: While troubleshooting, keep notes in a text file or a shared document. When the incident is over, those notes become the postmortem and the troubleshooting guide entry. Waiting until later means you'll forget the details.
- Review quarterly: Every three months, pick a section (inventory, backups, monitoring) and verify it against reality. Check that IP addresses are correct, backup jobs are running, and alert thresholds still make sense. Fix discrepancies immediately.
- Onboard with documentation: When a new team member joins, have them follow the runbooks to deploy an app, restore a backup, or troubleshoot a test incident. They'll find gaps and outdated instructions. Use their feedback to update the docs.
- Automate what you can: Generate the server inventory from your cloud provider's API or from Ansible facts. Export Grafana dashboards and firewall rules automatically. The less you maintain by hand, the more accurate it stays.
For a deeper look at building and maintaining operational documentation across larger teams, the Linux System Administration Handbook covers documentation strategies, tooling, and how to integrate docs into your CI/CD pipeline.
Frequently Asked Questions
Should I keep Linux server documentation in Git or a wiki?
Git is better for structured documentation like this template, config files, and runbooks. You get version history, diffs, and the ability to review changes via pull requests. Use Markdown or plain text files in a repository the whole team can clone. A wiki works for collaborative notes, meeting summaries, and exploratory content, but it's harder to track changes and enforce a structure. If you have both, put the core operational docs (inventory, runbooks, procedures) in Git and link to them from the wiki.
How often should I update system administration documentation?
Update it immediately when you make a change: provision a server, update a config, resolve an incident. Treat documentation as part of the task, not something you do later. For verification, review each section quarterly to catch drift. If you're using Git, commit config changes as you make them. If you find yourself saying "I'll update the docs tomorrow," you won't. Do it now while the details are fresh.
What is the minimum documentation needed for a small Linux server fleet?
Start with three things: a server inventory table (hostname, IP, role, specs), backup procedures with restore commands, and a list of critical services with restart instructions. That's enough to survive a disk failure or an on-call shift. Add firewall rules and monitoring setup next. You can skip elaborate runbooks if you only have 3-5 servers, but document anything that isn't obvious from the config files or that you've had to troubleshoot more than once.
How do I document firewall rules without exposing security details?
Store the full firewall ruleset in a private Git repository with restricted access. For public-facing documentation or a wiki, use a summary table that shows the purpose of each rule without listing internal IPs or specific ports. For example, "App servers can reach database on PostgreSQL port" instead of "10.0.1.0/24 to 10.0.2.5:5432". If you need to share runbooks with contractors or new hires, give them access to the private repository after they sign an NDA and have completed onboarding.
Should I document every command in a runbook or just the tricky parts?
Document enough that someone unfamiliar with the service can follow the procedure without guessing. Include the full command with flags, not just the tool name. Skip basic commands your team knows (systemctl restart, ls, cd), but include anything with non-obvious options, paths specific to your setup, or commands that are dangerous if run incorrectly. If you've ever had to look up the syntax or asked a colleague how to do something, document it. A good test: can a competent sysadmin who's never touched this server follow your runbook successfully?