Deploying a Laravel app with SSH and Composer
Updated 19/11/2026 · 2 min read
This is the quickest way to get a Laravel project live on a Laravel Business Hosting plan. It takes about ten minutes the first time.
1. Connect over SSH
In cPanel open SSH Access, add your public key and authorise it. Then connect from your computer:
ssh -p 22 [email protected]
Your shell is jailed to your own account, so you only see your own files.
2. Pull your code and install dependencies
cd ~ git clone https://github.com/you/your-app.git app cd app composer install --no-dev --optimize-autoloader
3. Set up the environment
Copy .env.example to .env, then add the database name, user and password you created in cPanel under MySQL Databases. Run:
php artisan key:generate php artisan migrate --force php artisan storage:link php artisan config:cache && php artisan route:cache && php artisan view:cache
4. Point the domain at /public
In cPanel go to Domains, edit your domain and set the document root to app/public. Your .env and source code then stay outside the web folder, where nobody can download them. If you would rather we do this step, send us a message and we will set it for you.
5. Pick the PHP version
Open Select PHP Version in cPanel and choose 8.2 or 8.3 to match your composer.json.
For later updates you only need git pull, composer install --no-dev and php artisan migrate --force.