Web Hosting & VPS Tips

Unleash Your Server Potential with Expert Insights

Hosting provided by: Cloudways
Free to Try! Up to 40% Off!

Category: VPS Setup

Add pre-up rules to UFW on Ubuntu for custom iptables—install with
apt install ufw
then edit /etc/ufw/before rules with
nano /etc/ufw/before.rules
adding before *filter:
*nat\n:PREROUTING ACCEPT [0:0]\n-A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8080\nCOMMIT
Allow port 8080 with
ufw allow 8080
enable with
ufw enable
This redirects port 80 to 8080—test with
curl localhost:8080
after starting a service (e g Apache) On Vultr this customizes MySQL or phpMyAdmin access—verify with
iptables -t nat -L
ensuring uptime with flexible port mapping

Back to All Tips