Search code examples
flutterdeploymentdnshostingcpanel

How to correctly deploy a Flutter web app using HostGator as a server?


I am attempting to deploy a Flutter web application and have chosen HostGator as my hosting server. Despite following the deployment process I used in the past, the website does not appear online. Below are the steps I've taken, followed by a description of the problem.

Deployment Steps:

  1. In the terminal, I executed the command to build the Flutter web app for release with the CanvasKit renderer:

    flutter build web --web-renderer canvaskit --release

  2. I compressed the build output into a ZIP file and uploaded it to the public_html directory within my cPanel's file manager, as shown in the screenshot below:

enter image description here

Previously, after updating the DNS settings, my website would be live within 3 days. However, this time, even after waiting, the website is not accessible.

Troubleshooting Attempts:

  • Checked DNS settings to ensure they are correctly pointed to the HostGator servers.
  • Verified that the public_html directory contains the correct build files from the Flutter project.

Despite these checks, the website remains offline.

Question:

What could be causing this deployment issue, and how can I resolve it to successfully deploy my Flutter web app on HostGator?

Thank you for any guidance or insights you can provide.


Solution

  • You are missing flutter.js file. Please check ./your-app/build/web folder for the missing file(s), or try to run flutter clean and then flutter build web again.