Deployment: Web Hosting
Transition from writing scripts to launching applications. Turn any Python project into a live, SSL-secured website in seconds.
Zero-Config Hosting
Python Online features an integrated hosting platform designed specifically for Python web frameworks (Flask, FastAPI, Django, and more). We have eliminated the complexity of server management, allowing you to deploy a production-ready application with a single click.
Deployment Workflow
Managing your live application is handled through the Hosting Tab in the Project Dashboard.
1. Custom Subdomain
You can choose a unique "Slug" for your application. When deployed, your app will be accessible at https://slug.pythononline.app. Security is not an option. Every application hosted on our platform is automatically provisioned with a wildcard SSL certificate. Your app is served over a secure https:// connection from the moment it goes live, with no manual configuration required.
2. Start Command
This is the exact command the server will run to launch your application. It should be the same command you would use to run your script in a local terminal.
The platform supports standard Python entry points, application servers (WSGI/ASGI), and framework-specific CLIs. You do not need to add special flags to bind to 0.0.0.0; our system handles external access automatically.
Examples:
python -m flask --app main runpython -m uvicorn main:appstreamlit run main.py
Not sure which command to use? Check out Start Commands Reference.
3. Internal Port
Different frameworks listen on different ports by default (e.g., Flask uses 5000, FastAPI uses 8000). Instead of changing your code, simply tell us which port your app is using.
- The Field: Enter the port number in the Internal Port box on the dashboard.
- The Magic: Our load balancer will automatically route public HTTPS traffic (Port 443) directly to the port you specified.
Not sure which port to use? Check out Ports Reference.
4. Resource Allocation
Python Online uses a smart, policy-based resource model to ensure your applications are both powerful and stable, without requiring manual configuration.
- Free Tier: Your 1 web application is allocated a static slice of hardware: 256MB RAM and 0.25 vCPU.
- Pro Tier: Every background workload (whether it's an Always-On App, an Ephemeral App, or a Scheduled Task) receives a dedicated slice from your global pool: 512MB RAM and 0.25 vCPU. The system automatically balances the remaining resources for your IDE.
Want a deeper dive? Check out the Elastic Resources Reference.
Architectural Guidelines
To ensure your application runs smoothly within our distributed mesh, please adhere to the following guidelines:
App Hosting Limits
- Free Tier: You can host 1 Active Web Application at any given time.
- Pro Tier: You can host 1 "Always-On" Application that runs 24/7, plus an unlimited number of Ephemeral apps that sleep when idle.
Network: Single Port Entry
The platform exposes a single HTTP/WebSocket entry point per project. If your application requires a separate frontend and backend running on different ports, they must be served as a monolith (e.g., FastAPI serving static frontend files).
Capability: Native WebSockets
WebSockets are supported natively on the same primary port. Frameworks like Streamlit, Gradio, and NiceGUI will work out-of-the-box without extra configuration.
The Hosting Lifecycle (Free vs. Pro)
Free Tier: Smart Hibernation
To keep the platform cost-effective, Free applications use an Ephemeral Lifecycle. If an app does not receive active traffic for a short period, the container is automatically "hibernated" to reclaim RAM.
If a visitor arrives while your app is sleeping, they are greeted by a "Wake Up" page. One click initiates a 1-2 second launch sequence that restores your app and redirects the user automatically.
Pro Tier: Tiered Availability
Pro users have access to two hosting modes:
- Always-On (1 App): You can designate one application as "Always On." It never sleeps, guaranteeing zero cold-start latency for your users.
- Ephemeral (Unlimited Apps): Any additional apps you deploy will follow the same Smart Hibernation lifecycle as the Free tier, sleeping when idle to conserve your global resource pool.
Monitoring & Maintenance
Once deployed, your application dashboard transforms into a real-time Hosting Cockpit.
Understanding Application Status
- Live: Your container is running and the health check is passing.
- Deploying: The system is pulling your project files, installing dependencies, and configuring the network route.
- Crashed / Failed: The Python process exited unexpectedly. This usually indicates a syntax error or a missing library in your code.
Accessing Server Logs
Debugging a web server requires visibility. You can access the raw stdout and stderr logs directly from the Cockpit. These logs capture every incoming request, Python print statement, and error traceback, making it the most important tool for troubleshooting deployment issues.