Allow Web Access To Your Site Within Your Local Network Using UFW And Ubuntu

Posted By Weston Ganger

I like to use my triple monitor desktop config instead of my laptop but I only keep work up to date on my laptop usually so its easier to just SSH in and work from the desktop.

You are required first to enable UFW to be able to recieve incoming HTTP traffic.

Here I describe how to setup UFW to allow incoming ports.

# Turn on the Firewall
sudo ufw enable

# See Firewall Status, including what is denied and allowed
sudo ufw status verbose

# Allow HTTP
sudo ufw allow 80

# Allow Local Rails Dev Port
sudo ufw allow 3000
sudo ufw allow 3001

# Allow SSH
sudo ufw allow 22

# If you want to need to turn it off
sudo ufw disable

I was having trouble with my laptops VPN after enabling the firewall. UFW was causing problems so I just disable it off when I am working from the laptop and want to use my VPN.

I also use guard-rails for my development server setup and I found that the binding defaults to which doesnt play nice with UFW so I set the default binding to

# Guardfile

guard :rails, host: '' do
  # watch stuff

Now you can access your development server remotely within the same network at http://192.168.1.:3000 Where is the IP of your remote machine.

Related External Links:

Article Topic:Software Development - Linux

Date:March 17, 2016