Basic Firewall Checklist for Ubuntu VPS

halfbrain_logo512adminJune 12, 2026
26 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.

Checklist Type Security
Level Beginner
Risk Level High Risk
Estimated Time 15–30 minutes

When to Use This Checklist

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

Required Tools

SSH access, Ubuntu VPS, UFW, VPS provider console, list of required ports

Before You Start

Make sure you know your SSH port and have VPS provider console access before enabling firewall rules.

Structured Checklist Steps

  1. Check current SSH port.
  2. Allow SSH.
  3. Allow HTTP.
  4. Allow HTTPS.
  5. Block unnecessary public ports.
  6. Enable UFW.
  7. Check UFW status.
  8. Test website.
  9. Test SSH in another terminal.
  10. Document open ports.

Rollback Plan

If you lock yourself out, use the VPS provider console to disable UFW or add the correct SSH allow rule.

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

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 *