Static Ports Setup


As a BTFS Host, you may need to set up a static port to a port number other than the default 4001, for example, to connect to renters for storage contracts. This guide walks Hosts through the setups needed to set up the ports on different operating systems.

BTFS Configuration Settings

To change the random swarm port, update the config file located under the .btfs directory. Update the port number under Swarm to your desired port. For example, to update to port 1234:

"Addresses": {
    "API": "/ip4/",
    "Announce": [],
    "Gateway": "/ip4/",
    "NoAnnounce": [],
    "RemoteAPI": "/ip4/",
    "Swarm": [

After updating the port value, be sure to restart your daemon:

btfs shutdown

btfs daemon

Machine Configuration

Users should also configure the machine settings to allow for the opening of specific ports.


Open firewall manually:

ufw allow 1234/tcp


  1. Navigate to Control Panel, System and Security, and Windows Firewall.
  1. Select Advanced settings and highlight Inbound Rules in the left pane. Click Inbound Rules and select New Rule.
  1. Select the Port radio button and click Next. Select the TCP protocol and add the port number in the Specific local ports text box. Then click Next.
  1. Select Allow the connection in the next window and hit Next.
  1. Select the profiles where you would like to apply this rule, and click Next.
  1. Give the rule a name and click Finish.