<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Bobby Orphé HOUESSINON</title>
    <description>The latest articles on DEV Community by Bobby Orphé HOUESSINON (@orphe_h00).</description>
    <link>https://dev.to/orphe_h00</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2703051%2F9d407c65-2760-4564-84f0-46fa8ed7f425.jpeg</url>
      <title>DEV Community: Bobby Orphé HOUESSINON</title>
      <link>https://dev.to/orphe_h00</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/orphe_h00"/>
    <language>en</language>
    <item>
      <title>Useful</title>
      <dc:creator>Bobby Orphé HOUESSINON</dc:creator>
      <pubDate>Tue, 25 Feb 2025 11:52:01 +0000</pubDate>
      <link>https://dev.to/orphe_h00/-5a91</link>
      <guid>https://dev.to/orphe_h00/-5a91</guid>
      <description>&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/riteshkokam/difference-between-docker-kubernetes-507a" class="crayons-story__hidden-navigation-link"&gt;Difference between Docker &amp;amp; Kubernetes&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;

          &lt;a href="/riteshkokam" class="crayons-avatar  crayons-avatar--l  "&gt;
            &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F681990%2Ff1affc61-c1d7-4aa9-8bdc-91c9891d8e62.png" alt="riteshkokam profile" class="crayons-avatar__image" width="612" height="612"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/riteshkokam" class="crayons-story__secondary fw-medium m:hidden"&gt;
              Ritesh Kokam
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                Ritesh Kokam
                
              
              &lt;div id="story-author-preview-content-2295796" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/riteshkokam" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&gt;
                        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F681990%2Ff1affc61-c1d7-4aa9-8bdc-91c9891d8e62.png" class="crayons-avatar__image" alt="" width="612" height="612"&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;Ritesh Kokam&lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

          &lt;/div&gt;
          &lt;a href="https://dev.to/riteshkokam/difference-between-docker-kubernetes-507a" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;Feb 24 '25&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/riteshkokam/difference-between-docker-kubernetes-507a" id="article-link-2295796"&gt;
          Difference between Docker &amp;amp; Kubernetes
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/docker"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;docker&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/kubernetes"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;kubernetes&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/cloud"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;cloud&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/webdev"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;webdev&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
          &lt;a href="https://dev.to/riteshkokam/difference-between-docker-kubernetes-507a" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left"&gt;
            &lt;div class="multiple_reactions_aggregate"&gt;
              &lt;span class="multiple_reactions_icons_container"&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/sparkle-heart-5f9bee3767e18deb1bb725290cb151c25234768a0e9a2bd39370c382d02920cf.svg" width="24" height="24"&gt;
                  &lt;/span&gt;
              &lt;/span&gt;
              &lt;span class="aggregate_reactions_counter"&gt;1&lt;span class="hidden s:inline"&gt;&amp;nbsp;reaction&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/a&gt;
            &lt;a href="https://dev.to/riteshkokam/difference-between-docker-kubernetes-507a#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              

              1&lt;span class="hidden s:inline"&gt;&amp;nbsp;comment&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            3 min read
          &lt;/small&gt;
            
              &lt;span class="bm-initial crayons-icon c-btn__icon"&gt;
                

              &lt;/span&gt;
              &lt;span class="bm-success crayons-icon c-btn__icon"&gt;
                

              &lt;/span&gt;
            
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;


</description>
      <category>docker</category>
      <category>kubernetes</category>
      <category>cloud</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Deploying a NestJS and Next.js Application on Dokku: Full-Stack Architecture</title>
      <dc:creator>Bobby Orphé HOUESSINON</dc:creator>
      <pubDate>Sat, 22 Feb 2025 12:34:59 +0000</pubDate>
      <link>https://dev.to/orphe_h00/deploying-a-nestjs-and-nextjs-application-on-dokku-full-stack-architecture-4n87</link>
      <guid>https://dev.to/orphe_h00/deploying-a-nestjs-and-nextjs-application-on-dokku-full-stack-architecture-4n87</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Deploying a full-stack application that consists of a &lt;strong&gt;NestJS backend&lt;/strong&gt; and a &lt;strong&gt;Next.js frontend&lt;/strong&gt; on a &lt;strong&gt;Dokku&lt;/strong&gt; server can be a powerful yet cost-effective solution. This article will guide you through the process of orchestrating both applications on a single Dokku instance.&lt;/p&gt;

&lt;h3&gt;
  
  
  Prerequisites
&lt;/h3&gt;

&lt;p&gt;Before proceeding, ensure you have the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;A server with Dokku installed &lt;a href="https://dev.to/orphe_h00/deploying-a-laravel-application-with-dokku-postgresql-and-redis-2em9"&gt;(installation guide in this article)&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A domain name (optional but recommended)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Basic knowledge of NestJS, Next.js, and Docker&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Step 1: Setting Up the Dokku Applications
&lt;/h3&gt;

&lt;p&gt;On your server, create two Dokku applications:&lt;/p&gt;

&lt;h3&gt;
  
  
  Create applications
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dokku apps:create my-nestjs-app
dokku apps:create my-nextjs-app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Set up database and environment variables&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Example for database&lt;/span&gt;
dokku plugin:install https://github.com/dokku/dokku-postgres.git

dokku postgres:create mydatabase

dokku postgres:link mydatabase my-nestjs-app

&lt;span class="c"&gt;# Example for environment variables&lt;/span&gt;
dokku config:set my-nestjs-app &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nv"&gt;APP_PORT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;5000 &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nv"&gt;NGINX_ROOT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;dist &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nv"&gt;JWT_SECRET&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;xxxxxxxxxxxxxxxxxx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 2: Configuring NestJS for Deployment
&lt;/h3&gt;

&lt;p&gt;Ensure your NestJS project has a &lt;code&gt;Procfile&lt;/code&gt; on the root folder:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;web: npm run start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, deploy your NestJS backend:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git remote add dokku dokku@your-server-ip:my-nestjs-app
git push dokku main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 3: Configuring Next.js for Deployment
&lt;/h3&gt;

&lt;p&gt;Next.js can be deployed similarly, but with custom environment variables:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dokku config:set my-nextjs-app &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nv"&gt;NEXT_PUBLIC_API_URL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"https://api.yourdomain.com"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nv"&gt;NGINX_ROOT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;.next
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Ensure your Next.js project has a &lt;code&gt;Procfile&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;web: npm run prod
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Deploy with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git remote add dokku dokku@your-server-ip:my-nextjs-app
git push dokku main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 4: Configuring Nginx and Domains
&lt;/h3&gt;

&lt;p&gt;If using domains, set them up with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dokku domains:set my-nestjs-app api.yourdomain.com
dokku domains:set my-nextjs-app yourdomain.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Enable SSL with Let's Encrypt:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dokku plugin:install https://github.com/dokku/dokku-letsencrypt.git
dokku letsencrypt my-nestjs-app
dokku letsencrypt my-nextjs-app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 5: Testing the Deployment
&lt;/h3&gt;

&lt;p&gt;Verify both applications are running:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dokku logs my-nestjs-app
dokku logs my-nextjs-app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Visit &lt;a href="https://yourdomain.com" rel="noopener noreferrer"&gt;https://yourdomain.com&lt;/a&gt; for the frontend and &lt;a href="https://api.yourdomain.com" rel="noopener noreferrer"&gt;https://api.yourdomain.com&lt;/a&gt; for the backend.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;By following this guide, you've successfully deployed a &lt;strong&gt;full-stack NestJS + Next.js application&lt;/strong&gt; on a &lt;strong&gt;Dokku&lt;/strong&gt; server. This setup allows for scalability, easy updates, and a structured separation between the frontend and backend.&lt;/p&gt;

&lt;h3&gt;
  
  
  Further Reading
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://dev.to/orphe_h00/deploy-a-nestjs-application-with-dokku-227c"&gt;Deploying a NestJS Application with Dokku&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://dev.to/orphe_h00/deploy-a-nextjs-application-with-dokku-2on7"&gt;Deploying a Next.js Application with Dokku&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let me know in the comments if you have any questions or need clarifications!&lt;/p&gt;

</description>
      <category>nestjs</category>
      <category>nextjs</category>
      <category>tutorial</category>
      <category>dokku</category>
    </item>
    <item>
      <title>[Boost]</title>
      <dc:creator>Bobby Orphé HOUESSINON</dc:creator>
      <pubDate>Sat, 22 Feb 2025 12:00:51 +0000</pubDate>
      <link>https://dev.to/orphe_h00/-52l7</link>
      <guid>https://dev.to/orphe_h00/-52l7</guid>
      <description>&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/pramod_boda/recommended-folder-structure-for-react-2025-48mc" class="crayons-story__hidden-navigation-link"&gt;Recommended Industry-Standard React.js Folder Structure&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;

          &lt;a href="/pramod_boda" class="crayons-avatar  crayons-avatar--l  "&gt;
            &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2564856%2Fbecded9b-ab48-4d36-be82-5b37d261696e.jpg" alt="pramod_boda profile" class="crayons-avatar__image" width="96" height="96"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/pramod_boda" class="crayons-story__secondary fw-medium m:hidden"&gt;
              Pramod Boda
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                Pramod Boda
                
              
              &lt;div id="story-author-preview-content-2291264" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/pramod_boda" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&gt;
                        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2564856%2Fbecded9b-ab48-4d36-be82-5b37d261696e.jpg" class="crayons-avatar__image" alt="" width="96" height="96"&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;Pramod Boda&lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

          &lt;/div&gt;
          &lt;a href="https://dev.to/pramod_boda/recommended-folder-structure-for-react-2025-48mc" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;Feb 21 '25&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/pramod_boda/recommended-folder-structure-for-react-2025-48mc" id="article-link-2291264"&gt;
          Recommended Industry-Standard React.js Folder Structure
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/react"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;react&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/reactjsdevelopment"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;reactjsdevelopment&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/folderstructure"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;folderstructure&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/webdev"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;webdev&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
          &lt;a href="https://dev.to/pramod_boda/recommended-folder-structure-for-react-2025-48mc" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left"&gt;
            &lt;div class="multiple_reactions_aggregate"&gt;
              &lt;span class="multiple_reactions_icons_container"&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/exploding-head-daceb38d627e6ae9b730f36a1e390fca556a4289d5a41abb2c35068ad3e2c4b5.svg" width="24" height="24"&gt;
                  &lt;/span&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/multi-unicorn-b44d6f8c23cdd00964192bedc38af3e82463978aa611b4365bd33a0f1f4f3e97.svg" width="24" height="24"&gt;
                  &lt;/span&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/sparkle-heart-5f9bee3767e18deb1bb725290cb151c25234768a0e9a2bd39370c382d02920cf.svg" width="24" height="24"&gt;
                  &lt;/span&gt;
              &lt;/span&gt;
              &lt;span class="aggregate_reactions_counter"&gt;259&lt;span class="hidden s:inline"&gt;&amp;nbsp;reactions&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/a&gt;
            &lt;a href="https://dev.to/pramod_boda/recommended-folder-structure-for-react-2025-48mc#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              

              20&lt;span class="hidden s:inline"&gt;&amp;nbsp;comments&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            4 min read
          &lt;/small&gt;
            
              &lt;span class="bm-initial crayons-icon c-btn__icon"&gt;
                

              &lt;/span&gt;
              &lt;span class="bm-success crayons-icon c-btn__icon"&gt;
                

              &lt;/span&gt;
            
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;


</description>
      <category>react</category>
      <category>reactjsdevelopment</category>
      <category>folderstructure</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Deploying a Next.js Application with Dokku</title>
      <dc:creator>Bobby Orphé HOUESSINON</dc:creator>
      <pubDate>Sat, 15 Feb 2025 14:20:36 +0000</pubDate>
      <link>https://dev.to/orphe_h00/deploy-a-nextjs-application-with-dokku-2on7</link>
      <guid>https://dev.to/orphe_h00/deploy-a-nextjs-application-with-dokku-2on7</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;In this article, we will deploy a Next.js application using Dokku (&lt;a href="https://dokku.com" rel="noopener noreferrer"&gt;https://dokku.com&lt;/a&gt;). &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;In a previous article, I explained how to deploy a Laravel application with Dokku, also presenting the basics of Dokku. If you are new to this tool, I recommend reading this article before continuing:&lt;/em&gt; &lt;a href="https://dev.to/orphe_h00/deploying-a-laravel-application-with-dokku-postgresql-and-redis-2em9"&gt;Deploying a Laravel Application with Dokku, PostgreSQL and Redis&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Assuming you already have Dokku installed on your VPS, let's continue with the configurations.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. What is Next.js
&lt;/h2&gt;

&lt;p&gt;Next.js is a &lt;strong&gt;React framework&lt;/strong&gt; for building modern web applications. It simplifies development by providing features like &lt;strong&gt;server-side rendering (SSR), static site generation (SSG), API routes, and automatic code splitting&lt;/strong&gt;. It's widely used for building fast, SEO-friendly, and scalable applications.&lt;/p&gt;

&lt;p&gt;The deployment process is rather simple.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Configuring the Next.js Application
&lt;/h2&gt;

&lt;h3&gt;
  
  
  A. Creating the Dokku Application
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dokku apps:create myapp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  B. Setting Environment Variables
&lt;/h3&gt;

&lt;p&gt;Replace the values in the following command and execute it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dokku config:set myapp &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nv"&gt;NEXT_PUBLIC_API_URL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;myapi.com &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nv"&gt;NGINX_ROOT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;.next
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  C. Assigning a Domain Name
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dokku domains:add myapp myapp.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  3. Deployment Configuration
&lt;/h2&gt;

&lt;p&gt;Based on your project structure, Dokku will recognize it as a Node.js application, use the appropriate buildpack, and execute your build script during the deployment phase.&lt;/p&gt;

&lt;h3&gt;
  
  
  A. &lt;code&gt;Procfile&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;Create a Procfile to define the processes to be executed:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;web: npm run start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  4. Configuring the Local Development Machine
&lt;/h2&gt;

&lt;h3&gt;
  
  
  A. Add Remote Repository
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git remote add dokku dokku@&amp;lt;SERVER_IP&amp;gt;:myapp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  B. Push the Application to Dokku
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git push dokku main:main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  5. Enabling SSL with Let’s Encrypt (optional)
&lt;/h2&gt;

&lt;p&gt;Secure your application with a free SSL certificate&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dokku letsencrypt:set myapp email you@example.com
dokku letsencrypt:enable myapp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;With this guide, your Next.js application is successfully deployed using Dokku. Thank you for reading!&lt;/p&gt;

</description>
      <category>nextjs</category>
      <category>tutorial</category>
      <category>docker</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Deploy a NestJS Application with Dokku</title>
      <dc:creator>Bobby Orphé HOUESSINON</dc:creator>
      <pubDate>Sun, 09 Feb 2025 16:29:15 +0000</pubDate>
      <link>https://dev.to/orphe_h00/deploy-a-nestjs-application-with-dokku-227c</link>
      <guid>https://dev.to/orphe_h00/deploy-a-nestjs-application-with-dokku-227c</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;In this article, we will deploy a NestJS application using Dokku (&lt;a href="https://dokku.com" rel="noopener noreferrer"&gt;https://dokku.com&lt;/a&gt;). &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;In a previous article, I explained how to deploy a Laravel application with Dokku, also presenting the basics of Dokku. If you are new to this tool, I recommend reading this article before continuing:&lt;/em&gt; &lt;a href="https://dev.to/orphe_h00/deploying-a-laravel-application-with-dokku-postgresql-and-redis-2em9"&gt;Deploying a Laravel Application with Dokku, PostgreSQL and Redis&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Assuming you already have Dokku installed on your VPS, let's continue with the configurations.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Setting Up Database
&lt;/h2&gt;

&lt;p&gt;Dokku provides official plugins for various databases, including PostgreSQL, MySQL, MongoDB. Let's continue with PostgreSQL.&lt;/p&gt;

&lt;h3&gt;
  
  
  A. Installing PostgreSQL Plugin
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;dokku plugin:install https://github.com/dokku/dokku-postgres.git postgres
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  B. Creating a PostgreSQL Database
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dokku postgres:create myapp_db
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  2. Configuring the NestJS Application
&lt;/h2&gt;

&lt;h3&gt;
  
  
  A. Creating the Dokku Application
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dokku apps:create myapp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  B. Linking the Database
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dokku postgres:link myapp_db myapp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the database is on another server:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dokku config:set myapp &lt;span class="nv"&gt;DATABASE_URL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;postgres://user:password@host:port/db_name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  C. Setting Environment Variables
&lt;/h3&gt;

&lt;p&gt;Replace the values in the following command and execute it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dokku config:set myapp &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nv"&gt;APP_PORT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;5000 &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nv"&gt;NGINX_ROOT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;dist &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nv"&gt;NODE_ENV&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;production
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;u&gt;NB:&lt;/u&gt; Dokku launches your application on port 5000, so you need to provide an environment variable (APP_PORT in this example) to specify the application port or set it to default to 5000.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;Example:&lt;/u&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;main&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ts&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;NestFactory&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@nestjs/core&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;AppModule&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./app.module&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;bootstrap&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;NestFactory&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;AppModule&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;appPort&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;APP_PORT&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="mi"&gt;5000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;listen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;appPort&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nf"&gt;bootstrap&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  D. Assigning a Domain Name
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dokku domains:add myapp myapp.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  3. Deployment Configuration
&lt;/h2&gt;

&lt;p&gt;Based on your project structure, Dokku will recognize it as a Node.js application to use the appropriate buildpack.&lt;/p&gt;

&lt;h3&gt;
  
  
  A. &lt;code&gt;Procfile&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;Create a Procfile to define the processes to be executed:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;web: npm run prod
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  4. Configuring the Local Development Machine
&lt;/h2&gt;

&lt;h3&gt;
  
  
  A. Add Remote Repository
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git remote add dokku dokku@&amp;lt;SERVER_IP&amp;gt;:myapp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  B. Push the Application to Dokku
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git push dokku main:main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  5. Enabling SSL with Let’s Encrypt (optional)
&lt;/h2&gt;

&lt;p&gt;Secure your application with a free SSL certificate&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dokku letsencrypt:set myapp email you@example.com
dokku letsencrypt:enable myapp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;With this guide, your NestJS application is fully deployed using Dokku. Dokku simplifies self-hosted deployments by providing a Heroku-like experience on your own server. You can now focus on building your application while leveraging a powerful and flexible deployment pipeline.&lt;/p&gt;

&lt;p&gt;If you found this guide helpful, feel free to share it or leave a comment!&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>webdev</category>
      <category>nestjs</category>
      <category>docker</category>
    </item>
    <item>
      <title>Very interesting and useful.</title>
      <dc:creator>Bobby Orphé HOUESSINON</dc:creator>
      <pubDate>Thu, 06 Feb 2025 11:31:13 +0000</pubDate>
      <link>https://dev.to/orphe_h00/very-interesting-and-useful-5bgn</link>
      <guid>https://dev.to/orphe_h00/very-interesting-and-useful-5bgn</guid>
      <description>&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/kelen/nodejs-23-new-features-and-improvements-21ak" class="crayons-story__hidden-navigation-link"&gt;NodeJs 23 New Features and Improvements&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;

          &lt;a href="/kelen" class="crayons-avatar  crayons-avatar--l  "&gt;
            &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F811244%2Fcfaeade2-3642-4df6-af0e-64d766115df5.png" alt="kelen profile" class="crayons-avatar__image" width="180" height="180"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/kelen" class="crayons-story__secondary fw-medium m:hidden"&gt;
              kelen.cc
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                kelen.cc
                
              
              &lt;div id="story-author-preview-content-2255141" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/kelen" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&gt;
                        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F811244%2Fcfaeade2-3642-4df6-af0e-64d766115df5.png" class="crayons-avatar__image" alt="" width="180" height="180"&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;kelen.cc&lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

          &lt;/div&gt;
          &lt;a href="https://dev.to/kelen/nodejs-23-new-features-and-improvements-21ak" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;Feb 2 '25&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/kelen/nodejs-23-new-features-and-improvements-21ak" id="article-link-2255141"&gt;
          NodeJs 23 New Features and Improvements
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/javascript"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;javascript&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/node"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;node&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/npm"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;npm&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
          &lt;a href="https://dev.to/kelen/nodejs-23-new-features-and-improvements-21ak" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left"&gt;
            &lt;div class="multiple_reactions_aggregate"&gt;
              &lt;span class="multiple_reactions_icons_container"&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/sparkle-heart-5f9bee3767e18deb1bb725290cb151c25234768a0e9a2bd39370c382d02920cf.svg" width="24" height="24"&gt;
                  &lt;/span&gt;
              &lt;/span&gt;
              &lt;span class="aggregate_reactions_counter"&gt;3&lt;span class="hidden s:inline"&gt;&amp;nbsp;reactions&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/a&gt;
            &lt;a href="https://dev.to/kelen/nodejs-23-new-features-and-improvements-21ak#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              

              &lt;span class="hidden s:inline"&gt;Add&amp;nbsp;Comment&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            3 min read
          &lt;/small&gt;
            
              &lt;span class="bm-initial crayons-icon c-btn__icon"&gt;
                

              &lt;/span&gt;
              &lt;span class="bm-success crayons-icon c-btn__icon"&gt;
                

              &lt;/span&gt;
            
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;


</description>
      <category>javascript</category>
      <category>node</category>
      <category>npm</category>
    </item>
    <item>
      <title>Deploying a Laravel Application with Dokku, PostgreSQL and Redis</title>
      <dc:creator>Bobby Orphé HOUESSINON</dc:creator>
      <pubDate>Fri, 31 Jan 2025 19:08:41 +0000</pubDate>
      <link>https://dev.to/orphe_h00/deploying-a-laravel-application-with-dokku-postgresql-and-redis-2em9</link>
      <guid>https://dev.to/orphe_h00/deploying-a-laravel-application-with-dokku-postgresql-and-redis-2em9</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;In this article, we will deploy a Laravel application using Dokku (&lt;a href="https://dokku.com" rel="noopener noreferrer"&gt;https://dokku.com&lt;/a&gt;), a lightweight Platform-as-a-Service (PaaS) that enables you to deploy applications on your own server easily.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. What is Dokku?
&lt;/h2&gt;

&lt;p&gt;Dokku is an open-source and extensible PaaS that runs on a single server of your choice. It allows you to deploy applications using Git and manage them similarly to Heroku.&lt;/p&gt;

&lt;h3&gt;
  
  
  Minimum Requirements for Dokku:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;A fresh installation of Ubuntu 20.04/22.04/24.04 or Debian 11+ x86_64 or arm64&lt;/li&gt;
&lt;li&gt;At least 1GB of system memory&lt;/li&gt;
&lt;li&gt;Optionally, a domain name pointing to your server’s IP address&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  2. Setting Up Dokku
&lt;/h2&gt;

&lt;h3&gt;
  
  
  A. Installing Dokku
&lt;/h3&gt;

&lt;p&gt;To install the latest stable version of Dokku, run the following shell commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;wget &lt;span class="nt"&gt;-NP&lt;/span&gt; &lt;span class="nb"&gt;.&lt;/span&gt; https://dokku.com/install/v0.35.14/bootstrap.sh
&lt;span class="nb"&gt;sudo &lt;/span&gt;&lt;span class="nv"&gt;DOKKU_TAG&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;v0.35.14 bash bootstrap.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This installation process takes around 5-10 minutes, depending on your internet speed.&lt;/p&gt;

&lt;h3&gt;
  
  
  B. Configuring SSH Key and Virtual Host Settings
&lt;/h3&gt;

&lt;p&gt;To allow deployment from another machine, add its SSH key:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dokku ssh-keys:add &amp;lt;NAME&amp;gt; &amp;lt;PATH_TO_PUBLIC_KEY&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"ssh-rsa ..."&lt;/span&gt; | dokku ssh-keys:add &amp;lt;NAME&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dokku ssh-keys:add developer ~/.ssh/developer.pub
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  3. Setting Up Databases and Caching
&lt;/h2&gt;

&lt;p&gt;Dokku provides official plugins for various databases, including PostgreSQL and Redis. We will install and configure them.&lt;/p&gt;

&lt;h3&gt;
  
  
  A. Installing PostgreSQL Plugin
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;dokku plugin:install https://github.com/dokku/dokku-postgres.git postgres
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  B. Creating a PostgreSQL Database
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dokku postgres:create myapp_db
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  C. Install Redis for Caching and Queues (Optional)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;dokku plugin:install https://github.com/dokku/dokku-redis.git redis
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  D. Creating a Redis Instance
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dokku redis:create myapp_redis
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  4. Configuring the Laravel Application
&lt;/h2&gt;

&lt;h3&gt;
  
  
  A. Creating the Dokku Application
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dokku apps:create myapp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  B. Linking the Database and Redis
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dokku postgres:link myapp_db myapp
dokku redis:link myapp_redis myapp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the database is on another server:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dokku config:set myapp &lt;span class="nv"&gt;DATABASE_URL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;postgres://user:password@host:port/db_name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  C. Setting Environment Variables
&lt;/h3&gt;

&lt;p&gt;Replace the values in the following command and execute it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dokku config:set myapp &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nv"&gt;APP_DEBUG&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;false&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nv"&gt;APP_ENV&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;prod &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nv"&gt;APP_NAME&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"My App"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nv"&gt;APP_URL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;https://myapp.com &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nv"&gt;ASSET_URL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;https://myapp.com &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nv"&gt;DB_CONNECTION&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;pgsql &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nv"&gt;MAIL_ENCRYPTION&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;ssl &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nv"&gt;MAIL_FROM_ADDRESS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;noreply@my-app.com &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nv"&gt;MAIL_FROM_NAME&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;MyApp &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nv"&gt;MAIL_HOST&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;smtp.mailer.com &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nv"&gt;MAIL_MAILER&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;smtp &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nv"&gt;MAIL_PASSWORD&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;yourpassword &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nv"&gt;MAIL_PORT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;2525 &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nv"&gt;MAIL_USERNAME&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;yourusername &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nv"&gt;NPM_CONFIG_PRODUCTION&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;false&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nv"&gt;YARN_PRODUCTION&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;false&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  D. Assigning a Domain Name
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dokku domains:add myapp myapp.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  E. Persistent Storage
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dokku storage:ensure-directory myapp_storage
dokku storage:mount myapp /var/lib/dokku/data/storage/myapp_storage:/app/storage
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  5. Deployment Configuration
&lt;/h2&gt;

&lt;p&gt;To ensure smooth deployment, we need to define configuration files for Dokku in your application.&lt;/p&gt;

&lt;p&gt;Create the following files on the root of your Laravel project&lt;/p&gt;

&lt;h3&gt;
  
  
  A. &lt;code&gt;.buildpacks&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;Its used to tell what kind of application you need to build.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;https://github.com/heroku/heroku-buildpack-nodejs
https://github.com/heroku/heroku-buildpack-php
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If your application is an API then use only the &lt;code&gt;heroku-buildpack-php&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  B. &lt;code&gt;php.ini&lt;/code&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;upload_max_filesize &lt;span class="o"&gt;=&lt;/span&gt; 200m
post_max_size &lt;span class="o"&gt;=&lt;/span&gt; 200m
memory_limit &lt;span class="o"&gt;=&lt;/span&gt; 512M
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  C. &lt;code&gt;nginx.conf&lt;/code&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;client_max_body_size 200m&lt;span class="p"&gt;;&lt;/span&gt;

location / &lt;span class="o"&gt;{&lt;/span&gt;
    index index.php&lt;span class="p"&gt;;&lt;/span&gt;
    try_files &lt;span class="nv"&gt;$uri&lt;/span&gt; &lt;span class="nv"&gt;$uri&lt;/span&gt;/ /index.php&lt;span class="nv"&gt;$is_args$args&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  D. &lt;code&gt;app.json&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;It's used to declare the deployment scripts.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="s2"&gt;"scripts"&lt;/span&gt;: &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="s2"&gt;"dokku"&lt;/span&gt;: &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="s2"&gt;"predeploy"&lt;/span&gt;: &lt;span class="s2"&gt;"./.scripts/predeploy.sh"&lt;/span&gt;,
            &lt;span class="s2"&gt;"postdeploy"&lt;/span&gt;: &lt;span class="s2"&gt;"./.scripts/postdeploy.sh"&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  E. &lt;code&gt;Procfile&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;Create a Procfile to define the processes to be executed:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;web: vendor/bin/heroku-php-nginx &lt;span class="nt"&gt;-C&lt;/span&gt; nginx.conf &lt;span class="nt"&gt;-i&lt;/span&gt; php.ini public/
worker: php artisan queue:work &lt;span class="nt"&gt;--timeout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;60 &lt;span class="nt"&gt;--sleep&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;3 &lt;span class="nt"&gt;--tries&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;3 &lt;span class="nt"&gt;--queue&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;high,default
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Scale the processes on the server:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dokku ps:scale myapp &lt;span class="nv"&gt;web&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1 &lt;span class="nv"&gt;worker&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  F. Deployment scripts
&lt;/h3&gt;

&lt;p&gt;Create a &lt;code&gt;.scripts&lt;/code&gt; folder on the root folder, then it this folder&lt;/p&gt;

&lt;p&gt;Create &lt;code&gt;predeploy.sh&lt;/code&gt; to optimize the application  before deployment:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#!/bin/bash&lt;/span&gt;

&lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; storage/app/public
&lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; storage/framework/&lt;span class="o"&gt;{&lt;/span&gt;cache/data,sessions,testing,views&lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; storage/logs

&lt;span class="nb"&gt;chmod&lt;/span&gt; &lt;span class="nt"&gt;-R&lt;/span&gt; 755 storage
&lt;span class="nb"&gt;chmod&lt;/span&gt; &lt;span class="nt"&gt;-R&lt;/span&gt; 755 public

php artisan storage:link

php artisan optimize
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create &lt;code&gt;postdeploy.sh&lt;/code&gt; to handle database migrations after deployment:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#!/bin/bash&lt;/span&gt;

php artisan migrate &lt;span class="nt"&gt;--force&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Make the scripts executable:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;chmod&lt;/span&gt; +x &lt;span class="nt"&gt;-R&lt;/span&gt; .scripts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  6. Configuring the Local Development Machine
&lt;/h2&gt;

&lt;h3&gt;
  
  
  A. Add Remote Repository
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git remote add dokku dokku@&amp;lt;SERVER_IP&amp;gt;:myapp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  B. Push the Application to Dokku
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git push dokku main:main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  C. Finalize Laravel Setup
&lt;/h3&gt;

&lt;p&gt;Generate the Laravel application key:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dokku run myapp php artisan key:generate &lt;span class="nt"&gt;--show&lt;/span&gt;
dokku config:set myapp &lt;span class="nv"&gt;APP_KEY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&amp;lt;PASTE_YOUR_KEY_HERE&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  7. Enabling SSL with Let’s Encrypt (optional)
&lt;/h2&gt;

&lt;p&gt;Secure your application with a free SSL certificate&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dokku letsencrypt:set myapp email you@example.com
dokku letsencrypt:enable myapp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;With this setup, your Laravel application is fully deployed using Dokku with PostgreSQL and Redis. Dokku simplifies self-hosted deployments by providing a Heroku-like experience on your own server. You can now focus on building your application while leveraging a powerful and flexible deployment pipeline.&lt;/p&gt;

&lt;p&gt;If you found this guide helpful, feel free to share it or leave a comment!&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>laravel</category>
      <category>docker</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
