Basic Firewall Checklist for Ubuntu VPS

halfbrain_logo512adminJune 12, 2026
1 lượt xem

Basic Firewall Checklist for Ubuntu VPS

A basic firewall is one of the first security layers for a new VPS. On Ubuntu, UFW is simple enough for beginners and useful enough for website operators. The goal is to allow only the ports you actually need.

Common ports

  • 22 for SSH.
  • 80 for HTTP.
  • 443 for HTTPS.
  • Custom app ports only when required.

Checklist

  1. Confirm your SSH port before enabling firewall.
  2. Allow SSH or your custom SSH port.
  3. Allow HTTP.
  4. Allow HTTPS.
  5. Do not open database ports to the public Internet.
  6. Enable UFW.
  7. Check UFW status.
  8. Test website access.
  9. Test SSH in a second terminal before closing the current session.
  10. Document all open ports.

Final check

A firewall is safe when SSH still works, website ports are open and unnecessary service ports are not exposed publicly.

Estimated Time

15–30 minutes

Use Case

Use this checklist when setting up a new Ubuntu VPS or reviewing basic server security for a website or automation stack.


Common Mistakes

  • Enabling firewall before allowing SSH.
  • Opening MySQL publicly.
  • Leaving random app ports exposed.
  • Not testing SSH in a second terminal.
  • Forgetting to document custom ports.

Related Commands

sudo ufw status
sudo ufw allow OpenSSH
sudo ufw allow 80
sudo ufw allow 443
sudo ufw enable
sudo ufw status numbered
See also  DNS A Record Checklist for Pointing Domain to VPS

Share:

Disclaimer: The guides, checklists, commands, and examples on HalfBrain.net are provided for educational and operational reference only. Server environments, hosting providers, software versions, security settings, and WordPress configurations can vary, so you should always review commands before running them on your own system. We do our best to keep the content accurate and useful, but we cannot guarantee that every command, configuration, or recommendation will fit every environment. Always back up your website, database, and server configuration before making changes. HalfBrain.net is not responsible for data loss, downtime, security incidents, misconfiguration, or other issues that may result from applying the information on this website. Use the material at your own discretion.

Leave a Reply

Your email address will not be published. Required fields are marked *