Hardware How To's

Expose a Public URL

In this guide we show you how you can fully-deploy your instance in one click. With Brev Public Ports, you can expose a port running on localhost to a public URL and easily send it to a friend, teammate, customer, or mother.

Within the Brev console

From the Brev console, click on your instance, open the Hardware tab, and scroll down to the "Public Ports" section


In the "Public Ports" section, add the port you wish to expose and click "Expose Port"


That's it! You can now share the URL with anyone you want.


Example: Build a Stable Diffusion API

To showcase this, we built a template to create a Fast API Stable Diffusion template. Run a Text to Image API right from your instance!

1. Clone the instance at this link.

2. Open your instance:

brev open stable-diffusion-fast-api --wait

3. Once VScode opens, run the server:

conda activate sd-api-server
uvicorn server:app --reload

4. Expose port 8000 via Brev and you've deployed Stable Diffusion!

If you need HTTPS

At the moment, the exposed url does not have HTTPS. If you need HTTPS, please let us know in the #feedback channel on our Discord and we'll prioritize it. In the meantime, you can use Ngrok to get an HTTPS url.

Step 1: Install Ngrok

# ngrok
curl -s https://ngrok-agent.s3.amazonaws.com/ngrok.asc | sudo tee /etc/apt/trusted.gpg.d/ngrok.asc >/dev/null && echo "deb https://ngrok-agent.s3.amazonaws.com buster main" | sudo tee /etc/apt/sources.list.d/ngrok.list && sudo apt update && sudo apt install ngrok

Step 2: Port forward your localhost port

# open port 3000 on a url
ngrok http 3000