Skip to main content

Web App Hosting

Run any web app on localhost and share it with the world. Alph automatically tunnels your app’s port to a public URL. How it works:
  1. Start your app on localhost (default port: 5000)
  2. Alph’s secure tunnel forwards your app
  3. Your app is live at https://{org}-{project}.runalph.dev
No configuration needed — just run your app and it’s accessible anywhere.

Frameworks examples

Streamlit

import streamlit as st

st.title('My Dashboard')
st.write('Hello from Alph!')
streamlit run app.py --server.port 5000

Gradio

import gradio as gr

def greet(name):
    return f"Hello {name}!"

demo = gr.Interface(fn=greet, inputs="text", outputs="text")
demo.launch(server_port=5000, server_name="0.0.0.0")

Flask

from flask import Flask
app = Flask(__name__)

@app.route('/')
def hello():
    return '<h1>Hello from Alph!</h1>'

if __name__ == '__main__':
    app.run(host='0.0.0.0', port=5000)

FastAPI

from fastapi import FastAPI
import uvicorn

app = FastAPI()

@app.get("/")
def read_root():
    return {"message": "Hello from Alph!"}

if __name__ == "__main__":
    uvicorn.run(app, host="0.0.0.0", port=5000)

Important: Bind to 0.0.0.0

Your app must bind to 0.0.0.0, not 127.0.0.1:
# Correct - accessible externally
app.run(host='0.0.0.0', port=5000)

# Wrong - only accessible locally  
app.run(host='127.0.0.1', port=5000)
Default port is 5000.

Running in Background

# Using tmux
tmux new -s webapp
python app.py
# Detach: Ctrl+B, then D

# Using nohup
nohup python app.py > app.log 2>&1 &

Environment Variables

Set secrets in project settings:
import os
api_key = os.getenv('API_KEY')

Troubleshooting

App not accessible:
  • Is app running? (ps aux | grep python)
  • Bound to 0.0.0.0?
  • Correct port (default 5000)?
Port in use:
lsof -i :5000
kill <PID>