Linux server hardening and setup
Most compromised servers were not hacked cleverly. They were left with password logins, open ports and unpatched software. We close those doors, test the result and hand you a record of every change.
- You getA server that matches current good practice, plus a document you or your next admin can follow.
- We needServer address and provider · Operating system and version · Temporary access we agree together, removed afterwards
- Not includedRewriting your application's code
- PriceFixed quote after a short call
Defense in layers: what a hardened server looks like
- 01
Cloudflare
DDoS filtering and WAF rules. Your origin IP stays hidden.
- 02
Firewall
Only ports 80 and 443 are public. SSH is restricted.
- 03
Web server
NGINX or Apache with modern TLS and security headers.
- 04
App user
PHP-FPM runs as its own low-privilege user.
- 05
Database
Listens on localhost only, with strong credentials.
- 06
Backups
An encrypted copy leaves the server every night.
This is the layout we use on our own servers. Your stack may differ; the principles do not.
Sample audit result
| Check | Typical finding | After Rootlab |
|---|---|---|
| SSH login | Passwords allowed, root login on | Keys only, root login off |
| Public ports | 9 open, several unused | 2 open: 80 and 443 |
| Updates | Manual, dozens pending | Automatic security patches |
| Backups | Same disk as the data | Encrypted, off-server, restore-tested |
| Certificates | Renewed by hand | Auto-renew with an alert |
Example of typical findings, not a real client.
What you get
Secure access
Key-only SSH, no direct root login, sudo users with named accounts.
Firewall
Default-deny rules. Only the ports your services need are reachable.
Patching
Automatic security updates with a reboot plan, so patches really apply.
Web stack
NGINX or Apache, PHP and your database installed and sized for the server.
TLS
Let's Encrypt certificates that renew themselves, with modern ciphers.
Attack surface
Brute-force protection, rate limits, unused services removed.
How the work runs
Audit
Read-only review of access, ports, updates, services and backups.
Backup
Snapshot or backup taken before the first change.
Harden
Changes applied in small, tested steps with a rollback for each.
Report
A written summary: what we found, changed and recommend next.
What we work with
- Ubuntu
- Debian
- CentOS
- CloudLinux
- NGINX
- Apache
- LiteSpeed
- PHP-FPM
- MySQL
- MariaDB
- UFW
- Fail2ban
- Let's Encrypt
- Cloudflare
- Server address and provider
- Operating system and version
- Temporary access we agree together, removed afterwards
What we do not do
- Rewriting your application's code
- Promising a server can never be attacked: no one honestly can
Questions about server setup and hardening
Can you harden a server that is already live?
Yes. We back up first, change in small steps and warn you in advance about anything that could cause a brief interruption.
How long does it take?
A single web server is usually a day or two of work. The quote states the timeline.
Will hardening break my site?
It should not. We test after each step and keep a rollback. Where a setting could affect your app, we ask first.
Read this first
Free, copy-and-paste guides on the same topic.
Related services
Tell us about your server
Two minutes of detail is enough. You get questions or a fixed-scope quote, and nothing starts until you say yes.