Python hosting

Deploy Python web applications, APIs and backend services. Deploy to a dedicated VPS in seconds — database auto-created, SSL installed, firewall locked down from the first boot.

3.9 – 3.13

Versions

PostgreSQL / MySQL

Database

Python

Category

SSL included
Firewall locked
DB auto-created
Live in minutes
Overview

What is Python?

Python is a general-purpose programming language widely used for web applications, REST APIs, automation, data processing, background jobs and backend services. Python web applications can be built with frameworks such as Django, Flask and FastAPI depending on the application's architecture and requirements.

A Python application gives developers flexibility to choose the framework, database, package ecosystem and deployment architecture that best fits the project. You can deploy a complete web application, a lightweight API, an internal dashboard, an automation service or a background worker on your own VPS.

Python applications normally run inside an isolated virtual environment so that each application can maintain its own Python packages and dependency versions. Production applications should run through a production application server such as Gunicorn or Uvicorn rather than Python's development server.

SharkCluster prepares the server environment around your Python application. You can select a supported Python runtime, deploy your project using Git, ZIP or SSH, configure a domain, install dependencies from requirements.txt or pyproject.toml, connect a database, enable HTTPS and run background tasks or scheduled jobs.

Quick facts

Version
3.9 – 3.13
Database
PostgreSQL / MySQL
Category
Python
  • SSL included
  • Firewall locked
  • DB auto-created
  • Live in minutes
Why SharkCluster

Why Python on SharkCluster?

Python runtime support

Run Python applications using a supported Python 3 runtime and isolate application dependencies with a dedicated virtual environment.

Django-ready environment

Deploy Django applications with WSGI support, database connectivity, static-file handling, migrations and production application-server configuration.

Flask-ready environment

Host lightweight Flask applications and APIs using Gunicorn behind nginx for a production-ready deployment architecture.

FastAPI-ready environment

Deploy asynchronous Python APIs using FastAPI with Uvicorn or Gunicorn with Uvicorn workers.

Database support

Connect Python applications to PostgreSQL, MySQL or other databases supported by your application and installed Python drivers.

Redis and background jobs

Use Redis for caching, queues and session-related workloads and run Celery workers for asynchronous background processing.

Production web server

Use nginx as a reverse proxy for Python application servers and serve static files efficiently while forwarding dynamic requests to the application.

SSH and developer access

Developers can use SSH to manage virtual environments, install dependencies, run migrations, inspect logs and execute application commands.

Features

What you get with Python

  • Deploy Python web applications and APIs

  • Python 3 runtime support

  • Virtual environment support with venv

  • Django application deployment

  • Flask application deployment

  • FastAPI application deployment

  • Gunicorn support for WSGI applications

  • Uvicorn support for ASGI applications

  • nginx reverse-proxy configuration

  • PostgreSQL database support

  • MySQL database support

  • Redis support for cache and queues

  • Celery-ready background workers

  • requirements.txt and pyproject.toml dependency support

  • Git, ZIP and SSH deployment options

  • Custom domain and subdomain support

  • Free Let's Encrypt SSL

  • Cron jobs for scheduled Python scripts

  • Application and server log access

  • Dedicated application system user

  • Firewall and server-level security controls

Use cases

What Python is built for

Django applications

Deploy full-featured Django websites, admin portals, SaaS applications, marketplaces and business platforms with database-backed functionality.

Flask applications

Host lightweight Flask websites, internal tools, APIs and custom backend services with a simple Python application architecture.

FastAPI services

Build and deploy high-performance REST APIs and asynchronous backend services using FastAPI and an ASGI application server.

REST APIs

Deploy Python APIs for web applications, mobile applications, SaaS platforms and third-party integrations.

Background workers

Run asynchronous processing jobs such as email delivery, report generation, data processing and external API synchronization.

Automation applications

Run Python scripts and services for scheduled automation, file processing, reporting, data synchronization and operational workflows.

Internal business tools

Host dashboards, administrative portals, reporting systems and custom business applications built with Python.

Data processing services

Deploy Python applications that process files, transform data, communicate with APIs or perform scheduled backend processing.

System requirements

Server specs for
Python

Not sure which plan to pick? The panel warns you before you deploy so you can choose the right size the first time.

  • Minimum specs shown before deploy
  • Panel blocks deploy if server is undersized
  • Upgrade path available inside the panel
Python
Python 3.10+ or a version compatible with the application.
Application server
Gunicorn for WSGI or Uvicorn for ASGI applications.
Web server
nginx recommended as a reverse proxy.
Database
PostgreSQL, MySQL, or another supported database.
Package manager
pip with requirements.txt or pyproject.toml.
Memory
2 GB RAM minimum; 4 GB+ recommended for production.
CPU
1–2 vCPU minimum; 2+ vCPU recommended for production.
Storage
10 GB+ SSD recommended, depending on application and data.
Architecture

How Python fits together

1

Domain

Your domain or subdomain points to the SharkCluster VPS through DNS.

2

nginx

nginx receives HTTP and HTTPS traffic, serves static files where appropriate and forwards application requests to the Python application server.

3

Gunicorn

Gunicorn runs Python WSGI applications such as Django and Flask using managed worker processes.

4

Uvicorn

Uvicorn runs ASGI applications such as FastAPI and supports asynchronous Python workloads.

5

Python application

Your Django, Flask, FastAPI or custom Python application handles routing, business logic, authentication, APIs and application processing.

6

Virtual environment

A dedicated Python virtual environment isolates the application's dependencies from other Python applications on the server.

7

PostgreSQL / MySQL

The application can store users, configuration, business data, transactions and other persistent information in a supported relational database.

8

Redis

Redis can provide fast caching, session storage or queue infrastructure depending on the application's architecture.

9

Celery workers

Celery workers can process asynchronous tasks such as emails, imports, reports and long-running background operations.

Python versions

Pick the Python runtime that fits

Use a supported Python version

For new production applications, use a Python version that is currently supported by the Python project and compatible with your framework and dependencies.

Match Python to your application

Before changing Python versions, check your framework version, requirements.txt or pyproject.toml, native dependencies and third-party packages.

Use isolated environments

Create a dedicated virtual environment for each application so package versions do not conflict with other Python projects on the server.

Test version changes

Test Python upgrades on staging first. Applications may depend on removed APIs, changed behavior or packages that do not yet support the target Python version.

Frameworks

Frameworks for Python

Django

Django provides a full web framework with routing, ORM, authentication, administration and many features required for database-backed web applications.

Flask

Flask is a lightweight Python web framework suitable for APIs, custom websites, internal tools and applications where developers want more control over the application structure.

FastAPI

FastAPI is designed for modern API development and supports asynchronous request handling through the ASGI ecosystem.

Custom Python

Python applications that do not use a major web framework can also be deployed when they provide a compatible WSGI, ASGI or other production service interface.

Background jobs

Async processing with Python

Celery workers

Use Celery workers to process long-running or asynchronous tasks outside the web request lifecycle.

Scheduled tasks

Use cron or the application's task scheduler for recurring jobs such as reports, imports, cleanup and synchronization.

Email processing

Move large email operations and notification workloads into background tasks so web requests do not wait for external mail services.

Data processing

Process large files, datasets or API responses asynchronously instead of performing expensive operations during normal HTTP requests.

API synchronization

Run scheduled workers that synchronize customers, products, orders or other records with external systems.

Framework commands

Python CLI commands

Create virtual environment

Create an isolated Python virtual environment for the application.

bash
python3 -m venv .venv

Activate virtual environment

Activate the application's Python virtual environment before installing packages or running application commands.

bash
source .venv/bin/activate

Install dependencies

Install Python dependencies defined in requirements.txt.

bash
pip install -r requirements.txt

Check Python version

Display the Python version used by the active environment.

bash
python --version

Django migrations

Apply pending Django database migrations.

bash
python manage.py migrate

Django collect static

Collect Django static files into the configured static root for production serving.

bash
python manage.py collectstatic --noinput

Django check

Run Django's deployment checks and identify common production configuration issues.

bash
python manage.py check --deploy

Gunicorn Django

Run a Django WSGI application through Gunicorn on a local interface behind nginx.

bash
gunicorn --bind 127.0.0.1:8000 project.wsgi:application

Gunicorn Flask

Run a Flask WSGI application through Gunicorn.

bash
gunicorn --bind 127.0.0.1:8000 app:app

Run FastAPI

Run a FastAPI application through Uvicorn on a local interface behind nginx.

bash
uvicorn main:app --host 127.0.0.1 --port 8000

Start Celery worker

Start a Celery worker for applications that use asynchronous background tasks.

bash
celery -A your_project worker --loglevel=INFO

Run development server

Start Django's development server for local testing. Do not use it as the production web server.

bash
python manage.py runserver 127.0.0.1:8000
Get started

After your Python deploy

  1. 1

    Choose your Python version

    Select a Python version compatible with your application and its dependencies. For new production projects, prefer a currently supported Python release.

  2. 2

    Upload or deploy your application

    Deploy your Python project using Git, ZIP, SSH or another supported deployment workflow.

  3. 3

    Create a virtual environment

    Create an isolated Python virtual environment for the application so its dependencies remain separate from other projects.

  4. 4

    Install dependencies

    Install the application's dependencies from requirements.txt, pyproject.toml or the dependency-management workflow used by the project.

  5. 5

    Configure environment variables

    Set database credentials, secret keys, API keys, application settings and other environment-specific configuration outside the source code where appropriate.

  6. 6

    Create the database

    Create the required PostgreSQL or MySQL database and configure the application with the generated database credentials.

  7. 7

    Run migrations

    Apply the application's database migrations before serving production traffic. Django applications commonly use manage.py migrate.

  8. 8

    Configure the application server

    Run Django or Flask applications with Gunicorn or another suitable WSGI server, and run FastAPI applications with Uvicorn or an ASGI-compatible server.

  9. 9

    Configure nginx

    Configure nginx as a reverse proxy and serve static files directly where appropriate.

  10. 10

    Enable HTTPS

    Connect your domain and enable a Let's Encrypt SSL certificate before exposing the application to production traffic.

  11. 11

    Configure background jobs

    If the application uses Celery or scheduled Python scripts, configure the required workers and cron jobs separately from the web application.

  12. 12

    Test the application

    Test authentication, APIs, database operations, file uploads, emails, background jobs, static files and important business workflows before going live.

Deployment

Ship Python your way

Git deployment

Clone or pull your Python project from a Git repository, activate the virtual environment and install the required dependencies.

ZIP deployment

Upload a ZIP archive, extract the project into the configured application directory and verify ownership and permissions.

SSH deployment

Use SSH to manage the virtual environment, install packages, run migrations, execute management commands and troubleshoot the application.

Requirements-based deployment

Install dependencies from requirements.txt to reproduce the application's expected Python package environment.

pyproject-based deployment

Applications using pyproject.toml can use their selected Python packaging and dependency-management workflow during deployment.

Process-based deployment

Run the web application and background workers as managed services so they automatically restart when required and remain available after server reboots.

Performance

Keeping Python fast

Use a production application server

Do not expose Django, Flask or FastAPI development servers directly to production traffic. Use Gunicorn, Uvicorn or another appropriate production server behind nginx.

Choose worker counts carefully

Gunicorn and application worker counts should be based on CPU, RAM, application behavior and measured traffic rather than simply increasing the number of processes.

Use asynchronous processing

Move long-running operations such as emails, reports, imports and external API calls into background workers when they do not need to block HTTP requests.

Use Redis for caching

Redis can provide fast cache storage and reduce repeated database or application processing for workloads that benefit from caching.

Optimize database queries

Review slow queries, indexes and ORM usage before increasing VPS resources. Efficient database access can significantly improve application response times.

Serve static files efficiently

Let nginx serve static assets directly rather than routing every CSS, JavaScript, image or other static request through the Python application.

Monitor memory usage

Python workers, database services, Redis and background workers all consume memory. Monitor actual usage and size the VPS according to the workload.

Monitor application logs

Review application, Gunicorn/Uvicorn, nginx and database logs to identify errors, slow requests and resource bottlenecks.

Production checklist

Ready your Python for launch

  • Use a supported Python version

  • Create a dedicated virtual environment

  • Install dependencies from a locked or controlled dependency definition

  • Configure production environment variables

  • Create a dedicated database and database user

  • Run database migrations

  • Configure Django DEBUG=False where applicable

  • Configure allowed hosts and trusted origins where applicable

  • Run Gunicorn or Uvicorn as a managed service

  • Configure nginx as a reverse proxy

  • Configure static and media file handling

  • Enable HTTPS

  • Configure application logging

  • Configure Celery workers where required

  • Configure Redis where required

  • Configure cron jobs for scheduled tasks

  • Review application and filesystem permissions

  • Use a dedicated application system user

  • Enable server firewall

  • Create application and database backups

  • Test backup restoration

  • Remove development configuration and debug settings

  • Test authentication and authorization

  • Test important API endpoints

  • Test file uploads

  • Test email delivery

  • Test background workers

  • Monitor CPU, RAM and disk usage

  • Review nginx and application logs before launch

Troubleshooting

Common Python issues & fixes

502 Bad Gateway

Cause
nginx cannot communicate with Gunicorn, Uvicorn or the configured Python application server.
Solution
Check the application service status, process logs, configured port or Unix socket and nginx reverse-proxy configuration.

Application service keeps stopping

Cause
The Python application may be crashing because of missing dependencies, invalid configuration, startup errors or insufficient resources.
Solution
Check the service logs and application traceback, activate the virtual environment and run the application manually to identify the startup error.

ModuleNotFoundError

Cause
A required Python package is missing or the application is running outside its virtual environment.
Solution
Activate the correct virtual environment and install the dependencies from requirements.txt or the project's dependency configuration.

Database connection failed

Cause
Incorrect credentials, unavailable database service, incorrect hostname or missing Python database driver.
Solution
Verify the database configuration, database service status, credentials, network settings and installed Python database package.

Django migration error

Cause
Pending migrations, incompatible model changes or database schema differences may prevent migrations from completing.
Solution
Review the migration output, check migration status and verify that the application is using the expected database.

Static files are missing

Cause
Static assets may not have been collected or nginx may not be serving the configured static directory.
Solution
Run the framework's static collection command, verify STATIC_ROOT or equivalent configuration and check the nginx static-file path.

Environment variables are missing

Cause
The application service may not load the same environment variables available in an interactive SSH session.
Solution
Verify the service environment configuration and make sure required variables are available to the process that starts the application.

Celery tasks are not running

Cause
The Celery worker may be stopped, incorrectly configured or unable to connect to Redis or another message broker.
Solution
Check the Celery worker logs, broker configuration, Redis status and task queue configuration.

Application is slow

Cause
Slow database queries, too many Python workers, expensive application logic, external API calls or insufficient server resources.
Solution
Review application and database performance first, then optimize queries, background jobs and worker configuration before increasing VPS resources.

Permission denied

Cause
The application system user does not have the required permissions for application files, logs, uploads or virtual-environment directories.
Solution
Review ownership and permissions and grant write access only to directories that actually require it.

Port already in use

Cause
Another Python process or service is already listening on the configured application port.
Solution
Identify the process using the port, stop or reconfigure the conflicting service and restart the Python application.

Python version mismatch

Cause
The application is running with a different Python version from the one used during development or dependency installation.
Solution
Check the active Python binary and virtual environment, then recreate or update the environment using the required Python version.
Security config

Hardened before your first request

Every deploy is locked down from boot — closed firewall, valid SSL, and restricted access by default.

  • Use a currently supported Python version whenever the application allows it.

  • Keep Django, Flask, FastAPI and other framework dependencies updated.

  • Store secret keys, database passwords and API credentials in environment-specific configuration rather than committing them to public repositories.

  • Use HTTPS for authentication, APIs and the entire production application.

  • Run the application under a dedicated system user instead of root.

  • Set Django DEBUG=False in production and never expose detailed production tracebacks to users.

  • Configure allowed hosts and trusted origins correctly for Django applications.

  • Validate and sanitize user input according to the application context.

  • Use secure authentication and password hashing provided by the framework or established security libraries.

  • Protect API endpoints with appropriate authentication, authorization and rate-limiting controls.

  • Restrict uploaded files and prevent untrusted files from being executed as application code.

  • Keep writable directories limited to locations that actually require write access.

  • Use a firewall and expose only the ports required by the application and administration workflow.

  • Keep Python package dependencies updated and remove unused packages.

  • Protect environment files, SSH keys and other application secrets from public access.

  • Create regular application and database backups.

Database

The data layer behind Python

PostgreSQL

PostgreSQL is a strong choice for Python applications and is commonly used with Django, FastAPI and other database-backed Python projects.

MySQL

Python applications can connect to MySQL using appropriate database drivers and ORM integrations.

Database configuration

Keep database credentials in environment-specific configuration and avoid hard-coding passwords into source code.

Migrations

Use your framework's migration system to create and update database schemas in a controlled and repeatable way.

Backups

Back up both application files and database data. Database backups should be tested periodically to ensure that they can actually be restored.

Security checklist

Lock down Python from day one

  • Use a supported Python release

  • Keep Python dependencies updated

  • Keep Django, Flask, FastAPI and other frameworks updated

  • Use HTTPS

  • Never expose production debug tracebacks

  • Store secrets in environment-specific configuration

  • Protect .env and configuration files

  • Use a dedicated application user

  • Use least-privilege filesystem permissions

  • Configure authentication and authorization correctly

  • Protect API endpoints

  • Validate user input

  • Secure file uploads

  • Use secure password hashing

  • Configure CSRF protection where applicable

  • Configure allowed hosts and trusted origins

  • Restrict database permissions

  • Keep Redis and database services protected from public access

  • Use firewall rules

  • Keep backups protected from public access

  • Remove unused Python packages and services

FAQ

Frequently Asked Questions

The questions we hear most from people deploying Python on SharkCluster.

Contact support

You can deploy Django, Flask, FastAPI and other Python web applications, REST APIs, internal tools, automation services and background-processing applications, provided the required Python version and dependencies are supported by the server.

Yes. Django applications can be deployed with a Python virtual environment, database, Gunicorn or another suitable WSGI server, nginx reverse proxy, static-file configuration and HTTPS.

Yes. Flask applications can run through Gunicorn behind nginx. You can configure the application with a virtual environment, database, environment variables and other services required by the project.

Yes. FastAPI applications can run using Uvicorn or Gunicorn with Uvicorn workers behind nginx. This is suitable for REST APIs and asynchronous Python services.

Use the newest Python version supported by your application, framework and dependencies. For new production projects, prefer a currently supported Python release and test compatibility before deployment.

Multiple Python versions can be used when the required runtimes are installed and supported by the server. Each application should use its own virtual environment and compatible Python interpreter.

A virtual environment isolates an application's Python packages from the system Python installation and other applications. This helps prevent dependency and version conflicts between projects.

Yes. PostgreSQL is commonly used with Django, FastAPI and other Python applications. Your application can connect through an appropriate Python database driver or ORM.

Yes. Python applications can connect to MySQL using compatible database drivers and framework integrations.

Yes. Redis can be used for caching, queues, session-related workloads and other fast-access data depending on your application's architecture.

Yes. Celery can run background workers for asynchronous tasks such as emails, reports, imports, notifications and external API synchronization. A message broker such as Redis is commonly used with Celery.

No. Development servers provided by frameworks such as Django and Flask are intended for development and testing. Production applications should use an appropriate application server such as Gunicorn or Uvicorn behind nginx.

A 502 usually means nginx cannot communicate with the Python application server. Check whether Gunicorn or Uvicorn is running, verify the configured port or socket and review the nginx and application logs.

A 500 error can be caused by an application exception, missing dependency, invalid environment variable, database problem or configuration error. Check the application service logs for the underlying Python traceback.

Yes. You can deploy a Python project from Git, create or update its virtual environment, install dependencies, run migrations and restart the application service as part of your deployment workflow.

Yes. Server cron can execute Python scripts at scheduled intervals for reports, imports, cleanup, synchronization, notifications and other recurring tasks.

Yes. Background workers such as Celery can run independently from the web application and process long-running or asynchronous tasks.

A lightweight development application may work with 1–2 vCPU and 1–2 GB RAM. Small production applications commonly benefit from 2 vCPU and 2–4 GB RAM, while larger applications, databases and background workers may require substantially more resources.

Yes, provided your application and dependencies support the target version. Test the application in staging, recreate or update the virtual environment and verify all dependencies before changing the production runtime.

SharkCluster provides and manages the server and deployment environment. Your Python source code, framework configuration, dependencies, database schema, application logic and third-party integrations remain under your control.

Yes. Multiple Python applications can run on the same VPS when sufficient CPU, RAM and storage are available. Each application should have its own directory, virtual environment, process configuration and domain or subdomain where required.

One-click setup

From deploy to live in minutes

Stack configured

Runtime, process manager and config files set up for you.

PostgreSQL / MySQL wired

Database created with a user and credentials in your config.

SSL + firewall

Free Let's Encrypt certificate and closed-by-default UFW rules.

Deploy anytime

Push with Git, or use the built-in file manager and ZIP upload.

Start your journey today

How do you start
with SharkCluster?

To start with SharkCluster, create an account and your first server on DigitalOcean, Contabo or OVHcloud — no credit card or lock-in contract is needed. Every account includes free self-hosted business apps, free local backups, unlimited migrations and a dedicated DevOps manager.

No lock-in contracts
No credit card required
Dedicated DevOps manager