Hosting your Flask Website on GoDaddy

A step-by-step, and detailed, walkthrough to host your Flask(python) Website on GoDaddy

Kanishk Varshney
4 min readJul 6, 2020
Photo by Halacious on Unsplash

Whenever someone wants to have their own website, they only think about funky animations and interactions. But once the exciting part of creating the web application in local environment is done, many of us have no clue how to make it available for the world to see. Since this isn’t the fancy work, there aren’t adequate comprehensive resources explaining the process. This blog will try to provide a step-by-step guide for this cumbersome but crucial task.

Although this tutorial is meant for flask web applications, the procedure should be similar for Django or any other python based web framework

Since I have only tried with Flask, I can’t guarantee other python frameworks will behave similarly. Above assumption is due to the procedure I followed didn’t require any flask specific work.

Getting Started

Make sure you have following things up and ready before we start with the hosting:

  1. Flask Application: Sounds obvious, but make sure the application is working in your local environment. Use Pip as your package manager, since GoDaddy Hosting Space supports Pip installations by default. You can choose other package managers like Conda, Poetry, etc. but that will increase your manual workload. Create a requirements.txt list file of your python packages
  2. GoDaddy Domain Name: This is the URL people will be visiting, make sure you have it up and running. You can just try to visit the URL, and confirm that you aren’t running into Page Not Found error
  3. Hosting Space: This is like a linux box on the GoDaddy Servers where you will be putting your code for your domain name to access. You will need to purchase a hosting plan(this is, and you can use external hosting spaces which suits your budget, experience, requirements, etc. This guide only talks about GoDaddy Hosting Space on GoDaddy Domain Name. I have a Starter Linux pack:
GoDaddy Starter Hosting Plan

Once you are done, your My Products section should look something similar to the following and we can proceed with the hosting

Domain name and Web Hosting space purchased

Hosting the Application

Hosting your website is a two step process:

  • Syncing your code on the Hosting Machine
  • Creating a Web Application to Run your code

Syncing Code on Hosting Machine

To sync the code you will need to login into your hosting machine via ssh(use Putty, if you are on Windows). But before that you will have to enable SSH access for the server. You can do this by redirecting to:

Enabling SSH access on your machine

My Products > Web Hosting > Manage > Settings > Server > SSH access > Manage

This takes about 24–48 hours to take effect. Hence, have a good day or two ;)

One the SSH access in On, the IP address mentioned above will be your host address. You can find your credentials in the adjacent Access tab

SSH login credentials

cPanel login is your username and the folder path where you will be syncing your code once logged in

You might need to reset password and relogin on the dashboard for SSH to work

Remote machine supports Github and Python3 by default, if it isn’t you might need to contact customer care to reset your machine (and redo the above steps)

Clone your repository to /home/<username/ or if you prefer you can manually sync your code here using FTP / file transfer tools.

You can also use cPanel Admin (black button as shown above) > Files > File Manager for syncing your code

Creating the Web Application

Once you are done with the code synving part, now it’s time to finally create the server application. For this you will need to goto:
cPanel admin > Software > Setup Pytho App

Click on Create Application, it will redirect you to the following page

  • Select your python version from the drop down. If your version isn’t mentioned you can install it by downloading/transfering the python installer in the Host Machine and restart the machine.
  • Give Application root same name as your code folder
  • Application URL should pick your domain name by default
  • Application startup file, is the entry point for your application that you use to run application in your development environment
  • Application Entry Point, this file will be created by the cPanel. GoDaddy hosts python apps via wsgi, just put in an new python file name(you can just use wsgi.py).
  • Passenger log file path is optional, but recommended.
  • Under Configurations files, add your requirements.txt and trigger the Run pip install. This will install all the code dependencies.

Now, click on the Create button near top right and Voila!!!

We are done and your website is out for the world to see. Have a good day ahead !!! :)

--

--

Kanishk Varshney

Data Scientist | Artist | Easing into Life | Buy me a coffee!