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

vipin93's avatar

How to deploy laravel app on vps using Rocketeer

I try to deploy my app on VPS server And I install Rocketeer when I hit artisan list its not showing deploy command any one know how to deploy Laravel project on VPS using Rocketeer

Thanks

0 likes
16 replies
vipin93's avatar

@blackbird I have problem with enviorment variable in L4.2 , when I run on local it fine but when on server it showing error my database config are

        'mysql' => array(
            'driver'    => 'mysql',
            'host'      => getenv('DB_HOST'),
            'database'  => getenv('DB_NAME'),
            'username'  => getenv('DB_USERNAME'),
            'password'  => getenv('DB_PASSWORD'),
            'charset'   => 'utf8',
            'collation' => 'utf8_unicode_ci',
            'prefix'    => '',
        ),
graham's avatar
graham
Best Answer
Level 12

Do you have a .env file on your server that defines values for each of your environment variables? If you're using git, .env files are usually excluded so may prefer to FTP the .env file to the server.

vipin93's avatar

@Graham On my server it not I clone my repo from bitbucket and I not include .env file

graham's avatar

If you don't have a .env file, where are you setting your environment variables on your VPS?

You will need someway to define environment variables and a specific .env file for your VPS might be the easiest way.

graham's avatar

Create a new .env file for your VPS and transfer it to the root of your project on your VPS (maybe via FTP).

You could change the git settings so that the .env file is managed using bitbucket but this is not considered to be a good security practice.

vipin93's avatar

@Graham but in when I run locally it showing error on database line no 59 where my databse setting start how to fix set for local development local enviorment and for production it production enviornment?

bobbybouwmann's avatar

Your .env for local development probably looks like this

DB_HOST=localhost
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret

Then your production .env looks the same, you only need to update the values of those variables

Please or to participate in this conversation.