👋 Enjoying the content? Subscribe to our Medium publication for more articles like this. 👇
Keep Learning

Deploy Symfony 6 App On Digital Ocean Droplet

BY Atakan Demircioğlu
Table of Contents

Notes about deploying Symfony applications with Github actions in a droplet.

Deploy Symfony 6 App On Digital Ocean Droplet image 1


Add these lines to the Nginx configuration:

root /var/www/project/public; 
location / {  
    try_files $uri /index.php$is_args$args; 

location /bundles {  
  try_files $uri =404; 

For more information visit here.

For deploying automatically in the droplet, configure a GitHub action.

Also, you need to add secrets to actions under your repository settings.

In the script part, you can add or remove lines about your needs.

For example, you can add additional commands.

php bin/console cache:clear # For clearing caches 
php bin/console doctrine:migrations:migrate # for migration db 
composer install --no-dev --optimize-autoloader # for packages ...