Deploying a Laravel application
Developer Guides
This guide covers deploying a Laravel application to TransPark hosting from scratch.
1. Create your site
- Go to Dashboard → Add Site
- Select PHP as the site type
- Enter your domain → Create
This creates a PHP site with a MySQL database. Save the credentials shown after creation.
2. Connect via SSH
Use the SFTP credentials shown at creation:
ssh siteuser@yoursite-com.transpark.tech
Your document root is: /home/[siteuser]/htdocs/[domain]/
3. Upload your Laravel project
Option A: Git clone (recommended)
cd /home/[siteuser]/htdocs/[domain] rm -rf ./* ./.* # Clear default files git clone https://github.com/your/repo.git .
Option B: SFTP upload
Upload your entire Laravel project to the document root.
4. Install dependencies
composer install --no-dev --optimize-autoloader
5. Configure environment
cp .env.example .env nano .env
Update these values in .env:
APP_URL=https://yoursite-com.transpark.tech DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_DATABASE=[your_db_name] DB_USERNAME=[your_db_user] DB_PASSWORD=[your_db_password]
Use the database credentials from site creation.
6. Generate app key and run migrations
php artisan key:generate php artisan migrate --force php artisan storage:link
7. Set the document root
Laravel serves from the public/ directory. In CloudPanel (access via SSO from your dashboard), go to your site's Vhost tab and change the root to:
/home/[siteuser]/htdocs/[domain]/public
Or ask support to update this for you.
8. Set permissions
chmod -R 775 storage bootstrap/cache chown -R [siteuser]:www-data storage bootstrap/cache
9. Optimize for production
php artisan config:cache php artisan route:cache php artisan view:cache
Updating your app
cd /home/[siteuser]/htdocs/[domain] git pull origin main composer install --no-dev --optimize-autoloader php artisan migrate --force php artisan config:cache php artisan route:cache