Expose a port
Make an app public or private and set the ports it listens on.
New apps are public and listen on the ports LILY detected in your code. This guide changes both settings. Networking explains how requests reach an app.
Before you start
- A deployed app. The examples use
cinderrock.
Steps
Make the app public or private
Open the app, select the Network tab and select Make app private or Make app public. The console marks public apps with a globe and private apps with a lock.
lly network cinderrock expose
lly network cinderrock hideThe change takes effect immediately, without a deploy.
Add or remove a service port
Ports use TCP unless you mark them as UDP. Ports below 1024 are ignored.
On the Network tab under Ports, enter the port, for example 8080, choose TCP or UDP and select Add. To remove a port, close it in the same list.
lly network cinderrock add-port 9090
lly network cinderrock add-port 5353/udp
lly network cinderrock remove-port 9090Check that it worked
lly network cinderrockA public app answers at https://cinderrock.lilylabs.app. The address of a private app does not resolve.
If it does not work
| What you see | Cause | Fix |
|---|---|---|
| The address does not resolve | The app is private | lly network cinderrock expose. See The app has no address. |
| The new port does not answer | The app was not redeployed after the change | lly redeploy cinderrock |
remove-port asks about connections | Other apps are connected on this port | Confirm to remove those connections as well, or keep the port |
Exit code 4 | The port does not exist on this app | Check with lly network cinderrock |
More messages and their fixes: Troubleshooting.
Use an agent
On my LILY app "cinderrock", add service port 9090 and keep the app private.
Run `lly network cinderrock add-port 9090`, `lly network cinderrock hide`, then `lly redeploy cinderrock`,
and show me the output of `lly network cinderrock`.