Note: I originally wrote this article on Medium.
So your awesome project is ready for deployment and you need to set it up on GoDaddy shared hosting servers.
Here are some things that you need before we get started:
- A GoDaddy shared hosting account
- SSH Access
- Awesome Laravel Project to be deployed
Before we start, let’s assume that your home directory on the server is
and all your code goes into the html folder.
- Create a folder on the same level as the html folder to hold your future Laravel installations. It’s just good practice.
- Connect via SFTP to your shared hosting server.
- Zip your entire project directory and upload it to the new folder you just created. Unzip it.
- Move the public folder into the html folder and rename it to something like awesome-project.
The approach mentioned above makes all of our application logic safe and our public folder is the one that is exposed.
Open up the index.php file and change the paths to reflect our new directory structure. Here are the following lines you should change:
Finally, we modify the main .htaccess file in the html directory. We do this so that you don’t have to type:
Here are the contents of the .htaccess file:
And you’re done! Try visiting:
and enjoy your awesome new project.
Please note that this article only discusses deploying the project files. If you need to deploy your migrations, there are tons of articles that you can look up. The confusing part is setting up the directory structure and this article covers that point.