You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a case of a few clicks in the interface with one of their ‘One-Click apps’.
You could also add a database in one of these servers by installing Adminer directly from the dashboard. But do remember to enable Basic Auth in the 'HTTP Settings' of the app.
Then keep a note of the credentials for the DB server; you'll be entering them alongside other .env contents into the dashboard of the 'app' that will hold your Laravel code.
Both choices are fine. If you want to have filesystem changes persisted between deploys in this Laravel context you would add /srv/app/storage as the 'Path in App' in the 'App Configs' section of the dashboard.
🚀 Future Scaling Consideration...
The transition to 'Serverless' hosting with something like Laravel Vapor or Google Cloud Run will be smoother if you don't rely on the local filesystem for your app.
Whilst you're inside the 'App Configs' section, enter all the relevant environment variables & hit 'Save & Update'.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
CapRover is an impressive open source tool that makes it easy to run various backend services on a rented VPS.
We can use it to help run Laravel apps confidently in production, rivalling benefits provided by services such as Laravel Forge.
Here’s the setup I’ve been using to successfully deploy to my own server:
https://github.com/jackbrycesmith/laravel-caprover-template
Prepping CapRover
Assuming you’ve got CapRover up and running, setup a database server of your choosing.
This is a case of a few clicks in the interface with one of their ‘One-Click apps’.
You could also add a database in one of these servers by installing Adminer directly from the dashboard. But do remember to enable Basic Auth in the 'HTTP Settings' of the app.
Then keep a note of the credentials for the DB server; you'll be entering them alongside other
.env
contents into the dashboard of the 'app' that will hold your Laravel code.Create your app inside CapRover
The only thing you need to consider is whether to make it have persistent directories or not.
Both choices are fine. If you want to have filesystem changes persisted between deploys in this Laravel context you would add
/srv/app/storage
as the 'Path in App' in the 'App Configs' section of the dashboard.🚀 Future Scaling Consideration...
Whilst you're inside the 'App Configs' section, enter all the relevant environment variables & hit 'Save & Update'.
Using the template
[/.deploy/Dockerfile](https://github.com/jackbrycesmith/laravel-caprover-template/blob/master/.deploy/Dockerfile)
[/.deploy/entrypoint.sh](https://github.com/jackbrycesmith/laravel-caprover-template/blob/master/.deploy/entrypoint.sh)
php artisan
commands hereNeed Laravel Horizon? Easy as...
.deploy/config/supervisor.conf
How about Websockets?
Install the fantastic Laravel Websockets package
Add appropriate environment variables in dashboard
Uncomment this section in
.deploy/config/supervisor.conf
Enable 'Websocket Support' in CapRover dashboard
✅ Websockets will be available on port 80/443 of your configured domains!
This is easier than what is involved for setting up in Laravel Forge.
Final tips
asset()
usage, by forcing HTTPS in yourAppServiceProvider.php
...Beta Was this translation helpful? Give feedback.
All reactions