Home Arrow Icon Knowledge base Arrow Icon Global Arrow Icon How do I set up Reverb's Forge integration for Laravel


How do I set up Reverb's Forge integration for Laravel


here are the steps to set up Reverb's Forge integration for Laravel:

Configuring Reverb in Laravel Forge

1. Disable Laravel Reverb: In your Laravel Forge site, go to the "Application" tab and turn off the toggle for Laravel Reverb.

2. Remove SSL certificate: You will need to issue a new SSL certificate for your site, including the Reverb subdomain.

3. Register an alias for your site: Go to the "Settings" tab of your Forge site and register a new alias with the `ws.` prefix. For example, if your app is at `example.com`, register `ws.example.com` as the alias.

4. Recreate SSL certificate: In the SSL tab, issue a new SSL certificate for both your site's hostname and the `ws.` alias.

5. Re-enable Laravel Reverb: This will re-enable the Reverb daemon and recreate the `reverb.conf` file, but this time it will listen on port 443 for secure WebSocket connections.

Deploying the Laravel Application to Forge

6. Provision the server: Set up a new server in Laravel Forge.

7. Get a (sub)domain: Acquire a domain or subdomain for your application.

8. Set DNS: Update your DNS settings to point to the newly provisioned server.

9. Push your code: Push your Laravel application's code to your source control provider.

10. Create a new site: In Forge, create a new site using the (sub)domain you acquired.

11. Secure the site: Enable SSL/TLS for your site using Let's Encrypt.

Configuring Laravel Echo

12. Update Laravel Echo: In your Laravel application, update the Laravel Echo configuration to use the `ws.` subdomain you registered earlier and the default HTTPS port 443.

By following these steps, you should be able to successfully integrate Laravel Reverb with your Laravel Forge-hosted application, ensuring seamless real-time communication in your production environment.

Citations:
[1] https://tonymasek.com/blog/how-to-make-laravel-reverb-work-on-laravel-forge
[2] https://dev.to/novu/the-ultimate-guide-to-laravel-reverb-275o
[3] https://laracasts.com/discuss/channels/laravel/problem-with-laravel-reverb-and-forge
[4] https://laracasts.com/discuss/channels/reverb/problem-with-laravel-reverb-and-forge
[5] https://laravel.com/docs/11.x/reverb