<?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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2703051%2F2602157d-9b20-43a4-b8e6-4df6979b692e.png</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"&gt;
  &lt;a href="/riteshkokam" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&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"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://dev.to/riteshkokam/difference-between-docker-kubernetes-507a" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Difference between Docker &amp;amp; Kubernetes&lt;/h2&gt;
      &lt;h3&gt;Ritesh Kokam ・ Feb 24&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#docker&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#kubernetes&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#cloud&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#webdev&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&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"&gt;
  &lt;a href="/pramod_boda" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&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%2F2564856%2Fbecded9b-ab48-4d36-be82-5b37d261696e.jpg" alt="pramod_boda"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://dev.to/pramod_boda/recommended-folder-structure-for-react-2025-48mc" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Recommended Folder Structure for React 2025&lt;/h2&gt;
      &lt;h3&gt;Pramod Boda ・ Feb 21&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#react&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#reactjsdevelopment&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#folderstructure&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#webdev&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&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"&gt;
  &lt;a href="/kelen" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&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"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://dev.to/kelen/nodejs-23-new-features-and-improvements-21ak" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;NodeJs 23 New Features and Improvements&lt;/h2&gt;
      &lt;h3&gt;kelen.cc ・ Feb 2&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#javascript&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#node&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#npm&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&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>
