# How do I deploy my Python app?

https://www.seturack.com/en/knowledgebase/article/how-do-i-deploy-my-python-app

1. In the panel, open **My servers** and click your server.
2. On the **Overview** tab, wait for the **App** row to say "Python is ready". The page refreshes itself.
3. Open the link in the **Site address** row. The sample page shows the Python version.

## Running your own app

[Connect over SSH](https://www.seturack.com/en/knowledgebase/article/how-to-connect-with-ssh) and switch to the app user:

`su - app`

`cd ~/uygulama`

Bring your code here, for example with `git clone`. Install your dependencies into the virtual environment:

`venv/bin/pip install -r requirements.txt`

Gunicorn runs the `app` object in `wsgi.py`. With Flask, edit that file so it provides your application object. Then go back to root with `exit` and restart it:

`systemctl restart uygulama`

To use a different module or FastAPI, change the `ExecStart` line in `/etc/systemd/system/uygulama.service` and run `systemctl daemon-reload`.

## Your own domain

1. Point your domain's A record to your server's IP address.
2. As root, replace the old name everywhere: `sed -i 's/OLD_NAME/yourdomain.com/g' /etc/caddy/Caddyfile`. `OLD_NAME` is the part after `https://` in the address shown in the panel.
3. Run `systemctl reload caddy`.

Caddy gets and renews the certificate by itself.

Only **80**, **443** and **22** for SSH are open to the outside.

**No server yet?** [Order a server with Python installed](https://www.seturack.com/en/python-vps): you choose the size and pay for what you choose.
