Creating a firewall
Follow these steps to create a firewall:1
Create a firewall
Log in to the dashboard, select a
project, navigate to Firewall in the sidebar menu, and click Create
Firewall. Provide a name for your firewall and click Create.
Navigating a firewall
After you create a firewall, Latitude.sh opens the firewall detail page with a tabbed layout:- Overview: Summary, rule preview, protected resources preview, and agent installation commands
- Rules: Create and edit inbound/outbound rules
- Resources: Assign or remove protected servers and virtual machines
- Settings: Delete the firewall
Setting firewall rules
After creating a firewall, follow these steps to add rules for inbound and outbound traffic:1
Add and configure firewall rules
Open the Rules tab, click New rule, and configure the rule settings:• From: Search/enter the source IP or select “Any” for all IPs.• To: Search/enter the destination IP or select “Any”.• Protocol: Choose TCP or UDP.• Port range: Enter a single port or a range using a hyphen (for example,
22 or 80-443).• Description: (Optional) Add a label to make the rule easier to identify (e.g., “Allow SSH from office”).Click Apply to save your changes.
Latitude.sh Firewall is built on UFW and only exposes TCP and UDP rules. ICMP traffic is permitted by default via UFW’s preloaded rules, so you don’t need (and can’t create) an ICMP rule. Port range must be between 1 and 65535.
Every firewall includes a default rule that allows inbound SSH — TCP on port 22 — from any source. Latitude.sh adds it automatically so you don’t lose SSH access when you assign a firewall to a server. It’s shown with a Default badge to identify it, and any rules you add appear alongside it.
Assigning a firewall to resources
You can assign a firewall to a server or virtual machine either from the Firewall detail page or from the resource’s own page:From the Firewall detail page
1
Assign the firewall to resources
Open the Resources tab and use the picker to add a server or virtual machine
to protect. The picker searches both servers and virtual machines in the current
project. A virtual machine that another firewall already protects can’t be
selected.The assigned list shows each resource’s type — server or virtual machine — and
links to that resource’s detail page.
2
Install or uninstall the firewall agent
Open the Overview tab, expand Agent Installation, and copy the
Install or Uninstall command.Run the command on each server or virtual machine to apply or remove the
Latitude.sh firewall agent configuration.
From the Server pages
1
Assign firewall from server page
Navigate to your server’s Overview or Network page and locate the Firewall assignments section. Click Assign to select from existing firewalls in your project, or create a new firewall directly from this interface.To remove a firewall assignment, click the delete icon next to the assigned firewall in the Firewall assignments section.
From the Virtual machine page
1
Assign firewall from the virtual machine page
Go to the virtual machine’s Overview page and use the Firewall assignment
section to assign a firewall. A virtual machine can be protected by only one
firewall at a time — a limit specific to virtual machines — so once one is
assigned the picker is no longer offered.To remove the assignment, use the same Firewall assignment section.
Managing firewall assignments from server and virtual machine pages provides
the same functionality as the centralized Firewall dashboard.
Renaming a firewall
1
Rename the firewall
Edit the Name field in the right-side Details panel, or use
Actions > Rename.
Firewall tags
You can tag a firewall from its detail page using the tag editor in the Details panel. The firewalls list page shows a Tags column and lets you filter firewalls by tag.Deleting a firewall
1
Delete the firewall
Open the Settings tab, click Delete, then type the firewall name to
confirm the deletion.
Using Firewall alongside Docker
Docker manages its own networking rules through iptables, which can interact unexpectedly with server-level firewalls like UFW. By default, Docker inserts its rules at a higher priority in the iptables chain than UFW, meaning incoming traffic to Docker containers bypasses UFW’s restrictions entirely. This behavior ensures Docker containers can communicate but may create security gaps if not properly managed. To maintain security when using Docker with Latitude.sh Firewall, you should explicitly control container networking through Docker’s own configuration:- Use Docker’s published ports (
-por--publishflag) to specify exactly which container ports should be accessible - Avoid using
--network hostmode unless absolutely necessary, as it bypasses Docker’s network isolation - Consider using Docker’s built-in network policies and internal networks for container-to-container communication