Create a Linode account to try this guide with a $100 credit.
This credit will be applied to any valid services used during your first 60 days.

Flask is a quick and light-weight web framework for Python that includes several utilities and libraries you can use to create a web application. It is designed to make getting started quick and easy, with the ability to scale up to support more complex applications.

Deploying a Marketplace App

The Linode Marketplace lets you easily deploy software on a Compute Instance using Cloud Manager. See Get Started with Marketplace Apps for complete steps.

  1. Log in to Cloud Manager and select the Marketplace link from the left navigation menu. This displays the Linode Create page with the Marketplace tab pre-selected.

  2. Under the Select App section, select the app you would like to deploy.

  3. Complete the form by following the steps and advice within the Creating a Compute Instance guide. Depending on the Marketplace App you selected, there may be additional configuration options available. See the Configuration Options section below for compatible distributions, recommended plans, and any additional configuration options available for this Marketplace App.

  4. Click the Create Linode button. Once the Compute Instance has been provisioned and has fully powered on, wait for the software installation to complete. If the instance is powered off or restarted before this time, the software installation will likely fail.

To verify that the app has been fully installed, see Get Started with Marketplace Apps > Verify Installation. Once installed, follow the instructions within the Getting Started After Deployment section to access the application and start using it.

Note
Estimated deployment time: Flask should be fully installed within 2-5 minutes after the Compute Instance has finished provisioning.

Configuration Options

  • Supported distributions: Debian 10
  • Recommended minimum plan: All plan types and sizes can be used.

Flask options

Limited Sudo User

You need to fill out the following fields to automatically create a limited sudo user, with a strong generated password for your new Compute Instance. This account will be assigned to the sudo group, which provides elevated permissions when running commands with the sudo prefix.

  • Limited sudo user: Enter your preferred username for the limited user. No Capital Letters, Spaces, or Special Characters.

    Locating The Generated Sudo Password

    A password is generated for the limited user and stored in a .credentials file in their home directory, along with application specific passwords. This can be viewed by running: cat /home/$USERNAME/.credentials

    For best results, add an account SSH key for the Cloud Manager user that is deploying the instance, and select that user as an authorized_user in the API or by selecting that option in Cloud Manager. Their SSH pubkey will be assigned to both root and the limited user.

  • Disable root access over SSH: To block the root user from logging in over SSH, select Yes. You can still switch to the root user once logged in, and you can also log in as root through Lish.

    Accessing The Instance Without SSH
    If you disable root access for your deployment and do not provide a valid Account SSH Key assigned to the authorized_user, you will need to login as the root user via the Lish console and run cat /home/$USERNAME/.credentials to view the generated password for the limited user.
  • Email address (required): Enter the email address to use for generating the SSL certificates.

Custom Domain (Optional)

If you wish to automatically configure a custom domain, you first need to configure your domain to use Linode’s name servers. This is typically accomplished directly through your registrar. See Use Linode’s Name Servers with Your Domain. Once that is finished, you can fill out the following fields for the Marketplace App:

  • Linode API Token: If you wish to use the Linode’s DNS Manager to manage DNS records for your custom domain, create a Linode API Personal Access Token on your account with Read/Write access to Domains. If this is provided along with the subdomain and domain fields (outlined below), the installation attempts to create DNS records via the Linode API. See Get an API Access Token. If you do not provide this field, you need to manually configure your DNS records through your DNS provider and point them to the IP address of the new instance.
  • Subdomain: The subdomain you wish to use, such as www for www.example.com.
  • Domain: The domain name you wish to use, such as example.com.
Warning
Do not use a double quotation mark character (") within any of the App-specific configuration fields, including user and database password fields. This special character may cause issues during deployment.

Obtain the Credentials

Once the app is deployed, you need to obtain the credentials from the server.

To obtain credentials:

  1. Log in to your new Compute Instance using one of the methods below:

    • 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.
    • SSH: Log in to your Compute Instance over SSH using the root user. To learn how, see Connecting to a Remote Server Over SSH.
  2. Run the following command to access the credentials file:

    cat /home/$USERNAME/.credentials

This returns passwords that were automatically generated when the instance was deployed. Save them. Once saved, you can safely delete the file.

Getting Started After Deployment

To get started:

  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. Make sure to use the https prefix in the URL to access the website securely.

  2. The deployment ships with a sample application, but you can review the flask app and it’s components below:

  • The sample project can be found in /var/www/flask_project
  • The Gunicorn systemd service can be found in /etc/systemd/system/gunicorn.service
  • The Gunicorn socket is located at /tmp/gunicorn.sock

Installed Software

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:

  • The NGINX 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.

  • An sample Flask application is downloaded to your Linode’s /var/www/flask_project directory.

  • Gunicorn, 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.

Note
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 and the Installed Software Section of this guide.

Next Steps

Note
Currently, Akamai doesn’t manage software and systems updates for Marketplace Apps. It is up to the user to perform routine maintenance on software deployed in this fashion.

Now that you are familiar with all the software installed on your Linode with the Flask Marketplace app, you can explore the following steps:

More Information

You may wish to consult the following resources for additional information on this topic. While these are provided in the hope that they will be useful, please note that we cannot vouch for the accuracy or timeliness of externally hosted materials.

This page was originally published on


Your Feedback Is Important

Let us know if this guide was helpful to you.