Flask

A lightweight Python web framework deployed with Gunicorn and Nginx for production apps.

1. SSH to Your Server

ssh root@<server-ip>

2. Find Login Credentials

  • Default user: flask
  • Password stored in: /root/.cloudzy-creds

(Optional) Change the default password: passwd flask

3. Switch to the App User

su - flask

4. Deploy Your App

A sample Flask app is already running and accessible at: http://<server-ip

To deploy your own app:

  1. Navigate to your application directory (or clone a new project): cd ~/flask_app
  2. (Optional) Replace default app: git clone <your_repo_url> .
  3. Activate the virtual environment: source venv/bin/activate
  4. Install required packages: pip install -r requirements.txt
  5. Make sure your WSGI entry point is named wsgi.py and contains: from your_module import app as application
  6. Restart Gunicorn to apply changes: sudo systemctl restart gunicorn

5. Access Your App

Your Flask app is available at: http://<server-ip

Nginx is reverse-proxying requests to Gunicorn via Unix socket.

6. Change Port or Domain?

To adjust domain, port, or add SSL:

  1. Edit Nginx site config: sudo nano /etc/nginx/sites-available/gunicorn
  2. Test configuration: sudo nginx -t
  3. Reload Nginx: sudo systemctl restart nginx

7. Enable HTTPS (Optional)

Use Certbot to enable HTTPS.

Application Details