What you need

* server, so a vps, old laptop, raspberry pi, anything, i use a raspberry pi running dietpi.

* domain name, I got mine from gandi... this unfortunately does mean you will have to spend money... but as an example, the ownership of kurowski.xyz cost me under 5USD.

setup

boot your server, and install dependencies.

sudo apt install nginx sudo apt install certbot sudo apt install python-certbot-nginx

creating python app and virtual enviroment.

mkdir website cd website python3 -m venv env source env/bin/activate pip install flask

create your main.py file, and copy paste this little template.

From flask import * app = Flask(__name__) @app.route('/') def hello(): return 'Hello, World!' if __name__ == '__main__': app.run()

create your SSL certificate, replace example.com with your domain name.

sudo certbot --nginx -d example.com -d www.example.com

certbot will make changes to your nginx file. all you really need to do is find location / {...} and edit that line to contain proxy pass... but you can also create a copy of the file and call it old_default, delete all the content, then copy paste the code below, replacing example.com with your domain name...

# this file is located in : /etc/nginx/sites-enabled/default server { location / { proxy_pass http://127.0.0.1:5000/; } listen [::]:443 ssl ipv6only=on; # managed by Certbot listen 443 ssl; # managed by Certbot ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; # managed by Certbot ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem; # managed by Certbot include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot } server { if ($host = www.example.com) { return 301 https://$host$request_uri; } # managed by Certbot if ($host = example.com) { return 301 https://$host$request_uri; } # managed by Certbot listen 80 ; listen [::]:80 ; server_name example.com www.example.com; return 404; # managed by Certbot }

congratulations, now you have a fully functioning website, if you know some html and css you can already start making modifications, you can also begin by googling how to use .html files in flask to get started.