|
2 | 2 | title: "Deploy Flask through the Linode Marketplace"
|
3 | 3 | description: "Learn how to deploy Flask, a quick and light-weight web framework for Python, through the Linode Marketplace."
|
4 | 4 | published: 2020-03-11
|
5 |
| -modified: 2022-03-08 |
| 5 | +modified: 2025-02-12 |
6 | 6 | keywords: ['flask','python','marketplace']
|
7 | 7 | tags: ["linode platform","python","marketplace","cloud-manager"]
|
8 | 8 | image: Flask_oneclickapps.png
|
@@ -32,39 +32,55 @@ license: '[CC BY-ND 4.0](https://creativecommons.org/licenses/by-nd/4.0)'
|
32 | 32 | - **Supported distributions:** Debian 10
|
33 | 33 | - **Recommended minimum plan:** All plan types and sizes can be used.
|
34 | 34 |
|
35 |
| -## Getting Started after Deployment |
| 35 | +## Flask options |
36 | 36 |
|
37 |
| -### Installed Software |
| 37 | +{{% content "marketplace-required-limited-user-fields-shortguide" %}} |
| 38 | +- **Email address** *(required)*: Enter the email address to use for generating the SSL certificates. |
38 | 39 |
|
39 |
| -In addition to installing Flask, this Marketplace app installs and configures software to support running Flask in a production environment. Below is a list of the installed software: |
| 40 | +{{% content "marketplace-custom-domain-fields-shortguide" %}} |
40 | 41 |
|
41 |
| -- The [NGINX](/docs/guides/getting-started-with-nginx-part-1-installation-and-basic-setup/) web server is installed with a basic NGINX configuration, located in `/etc/nginx/sites-enabled/flask_app`, and listening on your Linode's IP address. |
42 |
| -- An example Flask application is downloaded to your Linode's `/home/flask_app_project` directory. If you visit your [Linode's IP address](/docs/products/compute/compute-instances/guides/manage-ip-addresses/), you will see the example Flask application running and serving boiler plate blog content. |
43 |
| -- Your example Flask application's environment will be configured with basic settings located in the `/etc/config.json` file. |
44 |
| -- [Gunicorn](https://gunicorn.org/), a Python WSGI (web server gateway interface) HTTP Server for UNIX, is installed and running. It is used to forward requests from your NGINX web server to your Flask application. |
45 |
| -- [Supervisor](http://supervisord.org/), a client/server system that allows its users to monitor and control a number of processes on UNIX-like operating systems, is installed and running on your Linode. Its configuration file can be found in the following location, `/etc/supervisor/conf.d/flask_app.conf`. |
46 |
| -- The example Flask app's logs can be found in the following locations, `var/log/flask_app/flask_app.out.log` and `/var/log/flask_app/flask_app.err.log` |
| 42 | +{{% content "marketplace-special-character-limitations-shortguide" %}} |
| 43 | + |
| 44 | + |
| 45 | +### Obtain the Credentials |
| 46 | + |
| 47 | +Once the app is deployed, you need to obtain the credentials from the server. |
| 48 | + |
| 49 | +To obtain credentials: |
47 | 50 |
|
48 |
| -### Removing Default Application |
| 51 | +1. Log in to your new Compute Instance using one of the methods below: |
49 | 52 |
|
50 |
| -Users may find that they need to remove access to the default Flask application on port 80 to free up space for another application, or to otherwise remove components. The following steps can help to disable and decouple various aspects of the default Flask application included with the Flask Marketplace App: |
| 53 | + - **Lish Console**: Log in to Cloud Manager, click the **Linodes** link in the left menu, and select the Compute Instance you just deployed. Click **Launch LISH Console**. Log in as the `root` user. To learn more, see [Using the Lish Console](/docs/products/compute/compute-instances/guides/lish/). |
| 54 | + - **SSH**: Log in to your Compute Instance over SSH using the `root` user. To learn how, see [Connecting to a Remote Server Over SSH](/docs/guides/connect-to-server-over-ssh/). |
51 | 55 |
|
52 |
| -- Unlink the default NGINX site for the Flask app: |
| 56 | +1. Run the following command to access the credentials file: |
53 | 57 |
|
54 |
| - sudo unlink /etc/nginx/sites-enabled/flask_app |
| 58 | + ```command |
| 59 | + cat /home/$USERNAME/.credentials |
| 60 | + ``` |
55 | 61 |
|
56 |
| -- Stop the application from being monitored and maintained by supervisorctl: |
| 62 | +This returns passwords that were automatically generated when the instance was deployed. Save them. Once saved, you can safely delete the file. |
57 | 63 |
|
58 |
| - sudo supervisorctl stop all |
| 64 | +## Getting Started After Deployment |
59 | 65 |
|
60 |
| -- Remove configuration files for the Flask application: |
| 66 | +To get started: |
61 | 67 |
|
62 |
| - sudo rm -rf /home/flask_app_project |
63 |
| - sudo rm /etc/config.json |
| 68 | +1. Open a web browser and navigate to the domain you entered when creating the instance: `https://domain.tld`. If you didn't enter a domain, use your Compute Instance's default rDNS domain (`192-0-2-1.ip.linodeusercontent.com`). To learn more on viewing the rDNS value, see [Managing IP Addresses](/docs/products/compute/compute-instances/guides/manage-ip-addresses/). Make sure to use the `https` prefix in the URL to access the website securely. |
64 | 69 |
|
65 |
| -- Remove the Supervisor configuration files: |
| 70 | +1. The deployment ships with a sample application, but you can review the flask app and it's components below: |
66 | 71 |
|
67 |
| - sudo rm /etc/supervisor/conf.d/flask_app.conf |
| 72 | +* The sample project can be found in /var/www/flask_project |
| 73 | +* The Gunicorn systemd service can be found in /etc/systemd/system/gunicorn.service |
| 74 | +* The Gunicorn socket is located at /tmp/gunicorn.sock |
| 75 | +
|
| 76 | +### Installed Software |
| 77 | +
|
| 78 | +In addition to installing Flask, this Marketplace app installs and configures software to support running Flask in a production environment. Below is a list of the installed software: |
| 79 | +
|
| 80 | +- The [NGINX](/docs/guides/getting-started-with-nginx-part-1-installation-and-basic-setup/) web server is installed with a basic NGINX configuration, located in `/etc/nginx/sites-enabled/$DOMAIN`. The $DOMAIN will be the domain entered during deployment or the default rDNS address that comes with each instance. |
| 81 | +- An sample Flask application is downloaded to your Linode's `/var/www/flask_project` directory. |
| 82 | + |
| 83 | +- [Gunicorn](https://gunicorn.org/), a Python WSGI (web server gateway interface) HTTP Server for UNIX, is installed and running. It is used to forward requests from your NGINX web server to your Flask application. |
68 | 84 |
|
69 | 85 | {{< note >}}
|
70 | 86 | Many configuration files can be overwritten to support a new configuration instead of deleted outright. For more information on the default configuration, see our [Flask Installation Guide](/docs/guides/flask-and-gunicorn-on-ubuntu/) and the [Installed Software Section](/docs/marketplace-docs/guides/flask/#installed-software) of this guide.
|
|
0 commit comments