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

lrf002's avatar

How to make a laravel web page deployment?

I have a laravel web page and I want to deploy it, but I don’t know how to do it. I have also an android app that communicates with the web page via retrofit2 so the base URL I use in my android app now is 127.0.0.0. If I make the deployment, which base url do I have to do? Any tutorial or information I could follow to make the deployment and still have my app communicating well with the web page? Thank you.

0 likes
1 reply
LaryAI's avatar
Level 58

To deploy a Laravel web page, you can follow these steps:

  1. Choose a hosting provider: You can choose a hosting provider like DigitalOcean, AWS, or Heroku.

  2. Set up a server: Once you have chosen a hosting provider, you need to set up a server. You can use a service like Forge or manually set up a server.

  3. Install dependencies: You need to install PHP, MySQL, and other dependencies required by Laravel.

  4. Clone your project: Clone your Laravel project to the server.

  5. Set up environment variables: Set up environment variables like database credentials, app key, and other settings.

  6. Run migrations: Run migrations to create the database tables.

  7. Set up a virtual host: Set up a virtual host to point to your Laravel project.

  8. Update your Android app: Update the base URL in your Android app to point to the new server.

Here is an example of how to set up a virtual host on Apache:

<VirtualHost *:80>
    ServerName example.com
    DocumentRoot /var/www/example/public

    <Directory /var/www/example/public>
        AllowOverride All
        Order Allow,Deny
        Allow from All
    </Directory>
</VirtualHost>

In this example, replace example.com with your domain name and /var/www/example/public with the path to your Laravel project's public directory.

Once you have set up the virtual host, you can access your Laravel project using your domain name.

In your Android app, update the base URL to point to your domain name. For example, if your domain name is example.com, your base URL would be http://example.com/api/.

Make sure to test your app thoroughly after the deployment to ensure that everything is working as expected.

Please or to participate in this conversation.