Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

churros's avatar

How to take a complete Laravel app from local server to a shared website host?

Hi,

I'm new to Laravel, and I did a small project on my local machine using XAMPP. Now I want to take the project to an online server. The project is versioned on Github.

I already have a simple hosting plan on Hostgator. I never put online a Laravel project and the thing is that I want to put there the full project. With the files and the local DB (with all the data and relationships), because I am already using the project on my daily routine.

What is the best way to perform this task? Can anyone give me a little help?

0 likes
3 replies
jlrdw's avatar

Through Git, or ftp. Just import the data into mysql.

1 like
churros's avatar

Ok, I'm having a little trouble creating the relationships on the database after the data import. I can't create the constrains. Can Laravel help me with that in any way?

jlrdw's avatar

The relationships should be there already from the code in the development branch. Remember, Linux is case sensitive. So if you have a wrong class name or namespace, you will get errors.


Windows
Case = case


Linux
Case <> case

But if your code worked locally but not in production, look for these types of things. Also check things like correct php version, proper folder permissions, etc.

Just my suggestions.

Edit: Did you use migrations, or setup foreign keys yourself. If you need to tweak something, you could use phpmyadmin.

Edit: See https://laravel.com/docs/8.x/migrations#foreign-key-constraints

I suggest backup all your data somewhere in case of any export import errors.

1 like

Please or to participate in this conversation.