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.
DELETE-ALL-FIREWALLS to confirm, or DELETE-FIREWALL if you selected one, then click Delete. Firewalls that canât be deleted are listed with their error. Fix the problem, type the confirmation word again and click Retry to delete the rest. The checkboxes only appear if your role can edit firewalls.
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