<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Jiri Palas]]></title><description><![CDATA[Jiri Palas personal page]]></description><link>jiripalas.com</link><generator>RSS for Node</generator><lastBuildDate>Sun, 01 Jul 2018 17:59:55 GMT</lastBuildDate><item><title><![CDATA[Deploying Express site with Dokku]]></title><description><![CDATA[In this post I’ll give a step by step tutorial on how to set up and deploy your first simple site with  Node.js , using the  Express…]]></description><link>jiripalas.com/posts/2017-11-02-deploying-express-site-with-dokku/</link><guid isPermaLink="false">jiripalas.com/posts/2017-11-02-deploying-express-site-with-dokku/</guid><pubDate>Wed, 02 Nov 2016 12:00:00 GMT</pubDate><content:encoded>&lt;p&gt;In this post I’ll give a step by step tutorial on how to set up and deploy your first simple site with &lt;a href=&quot;http://nodejs.org&quot;&gt;Node.js&lt;/a&gt;, using the &lt;a href=&quot;http://expressjs.com&quot;&gt;Express&lt;/a&gt; framework, deployed to &lt;a href=&quot;http://digitalocean.com&quot;&gt;Digital Ocean&lt;/a&gt; using &lt;a href=&quot;http://dokku.viewdocs.io&quot;&gt;Dokku&lt;/a&gt;.&lt;/p&gt;
&lt;h3&gt;Dokku&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;http://dokku.viewdocs.io&quot;&gt;Dokku&lt;/a&gt; is docker powered &lt;em&gt;“mini-Heroku”&lt;/em&gt;. Dokku provides a better interface to app deployment, comparable to the offerings of Heroku. It works for any VPC, but I favor DigitalOcean for quick setup and ease of use.&lt;/p&gt;
&lt;h3&gt;Digital Ocean&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;http://digitalocean.com&quot;&gt;DigitalOcean&lt;/a&gt; is a great place to host your web apps, being cheaper than other, managed services or &lt;a href=&quot;http://heroku.com&quot;&gt;Heroku&lt;/a&gt;. It has a $5/month plan, and using the DigitalOcean promo code gives you $10 credit (two months) for free to try it out.&lt;/p&gt;
&lt;h2&gt;Sign up&lt;/h2&gt;
&lt;p&gt;Use this &lt;a href=&quot;https://m.do.co/c/97a3ba42afda&quot;&gt;link&lt;/a&gt; to Sign up for DigitalOcean. You’ll get 10$ for free out that. Down side is that you have to add a credit card (I’d’ love to not have to do this, but they don’t charge you until you run out of credit.) or pay 5$ credit via PayPal.&lt;/p&gt;
&lt;h2&gt;Get Domain (Optional)&lt;/h2&gt;
&lt;p&gt;Get your self a domain that makes all things cleaner.&lt;/p&gt;
&lt;h2&gt;Setup SSH Key&lt;/h2&gt;
&lt;p&gt;If you don’t have SSH Key generate it otherwise just skip the following step.&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot;&gt;
      &lt;pre class=&quot;language-bash&quot;&gt;&lt;code class=&quot;language-bash&quot;&gt;ssh-keygen -t rsa -b 4096 -C &lt;span class=&quot;token string&quot;&gt;&quot;your_email@example.com&quot;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
      &lt;/div&gt;
&lt;p&gt;Now copy your SSH Key to clipboard&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot;&gt;
      &lt;pre class=&quot;language-bash&quot;&gt;&lt;code class=&quot;language-bash&quot;&gt;pbcopy &lt;span class=&quot;token operator&quot;&gt;&amp;lt;&lt;/span&gt; ~/.ssh/id_rsa.pub&lt;/code&gt;&lt;/pre&gt;
      &lt;/div&gt;
&lt;p&gt;Navigate to &lt;code class=&quot;language-text&quot;&gt;Click on profile picture &amp;gt; Settings &amp;gt; Add SHH Key&lt;/code&gt; and paste you link.&lt;/p&gt;
&lt;h2&gt;Create Digital Ocean Droplet&lt;/h2&gt;
&lt;p&gt;If you have a real domain available use that as your hostname.
Select the dokku app from the list of applications.

  &lt;a
    class=&quot;gatsby-resp-image-link&quot;
    href=&quot;/static/create-droplet-5ca3727e661b6225afc155110430344a-e1f19.png&quot;
    style=&quot;display: block&quot;
    target=&quot;_blank&quot;
    rel=&quot;noopener&quot;
  &gt;
  
  &lt;span
    class=&quot;gatsby-resp-image-wrapper&quot;
    style=&quot;position: relative; display: block; ; max-width: 590px; margin-left: auto; margin-right: auto;&quot;
  &gt;
    &lt;span
      class=&quot;gatsby-resp-image-background-image&quot;
      style=&quot;padding-bottom: 47.16796874999999%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAJCAYAAAAywQxIAAAACXBIWXMAABYlAAAWJQFJUiTwAAABGklEQVQoz5VS2W7DMAzz///mHrYBTWI7vi+OcpqgHZCHCiDiQBJNUVYxRmzbBq01rLVYlgUhBEiMMSY+CZVzxr7v8N4TDo7nWusb4SdQQrStK0kdlnWD5feO7IyB+5xqvaP3hkRRDw/sCRfha9wR/M+pUSoyfYwp0bs4/YspzrGt4TkmJOZKKVdT64U1HumZk9qLsLXK4jwbJNFae6Jj91JcJpr4OpUNZJ5DyqjskT6pvwhzy/DRI/gwbzvHKST8WgM0PTDuQCoDtQErL3oYR4VhLvNVvYq5UX6BbFtwbHiwueNbEwb4scAvYSKg+aJCScjFs77M6d48NCQ0gbc/fRT5Ep3LCvnw1FGFvNfEMTubKmXK/4mzRwj/APVhw5nlWjeZAAAAAElFTkSuQmCC&apos;); background-size: cover; display: block;&quot;
    &gt;
      &lt;img
        class=&quot;gatsby-resp-image-image&quot;
        style=&quot;width: 100%; height: 100%; margin: 0; vertical-align: middle; position: absolute; top: 0; left: 0; box-shadow: inset 0px 0px 0px 400px white;&quot;
        alt=&quot;create-droplet&quot;
        title=&quot;&quot;
        src=&quot;/static/create-droplet-5ca3727e661b6225afc155110430344a-fb8a0.png&quot;
        srcset=&quot;/static/create-droplet-5ca3727e661b6225afc155110430344a-1a291.png 148w,
/static/create-droplet-5ca3727e661b6225afc155110430344a-2bc4a.png 295w,
/static/create-droplet-5ca3727e661b6225afc155110430344a-fb8a0.png 590w,
/static/create-droplet-5ca3727e661b6225afc155110430344a-526de.png 885w,
/static/create-droplet-5ca3727e661b6225afc155110430344a-fa2eb.png 1180w,
/static/create-droplet-5ca3727e661b6225afc155110430344a-08f6a.png 1770w,
/static/create-droplet-5ca3727e661b6225afc155110430344a-e1f19.png 2048w&quot;
        sizes=&quot;(max-width: 590px) 100vw, 590px&quot;
      /&gt;
    &lt;/span&gt;
  &lt;/span&gt;
  
  &lt;/a&gt;
    

  &lt;a
    class=&quot;gatsby-resp-image-link&quot;
    href=&quot;/static/create-droplet2-8f7f334eb85f8d0d7e05b561abfa6735-a9316.png&quot;
    style=&quot;display: block&quot;
    target=&quot;_blank&quot;
    rel=&quot;noopener&quot;
  &gt;
  
  &lt;span
    class=&quot;gatsby-resp-image-wrapper&quot;
    style=&quot;position: relative; display: block; ; max-width: 590px; margin-left: auto; margin-right: auto;&quot;
  &gt;
    &lt;span
      class=&quot;gatsby-resp-image-background-image&quot;
      style=&quot;padding-bottom: 49.75369458128079%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAKCAYAAAC0VX7mAAAACXBIWXMAABYlAAAWJQFJUiTwAAABGUlEQVQoz41S2W6EMAzk/z+xr6VbgbgSQk7INOMqqKV0tZZCnNgejyc0Zl0xTROU0jBmAy3nfO7Vv57/8xvtMqzfkaJHCOFX8R3QXeyn30yF1KcCtDsQUob3Ds45SYgxFtYGx3HIWss0KSWJ8d57Lz53xgRQWeCty3ifMsIOLPOEYRzPosfjgX3fZbVtC2utxLquE6loy7JIjE2bzSWoZS5dgjA0ZpWO7MbiypBy0CdDgpMR75i3bZvkfgMW/ayP8JEjHyU5nSNWZtVno3qmT3ACUhqCCyA/bfsBrVeh3/e9jEMjC45SdbuzP4+yl+RhGM6HmOe5gOtTw7HoSVYv/zakSwDuLFRKyThkTm0IegV8tppXkq5sntkX/V4RaoXun3YAAAAASUVORK5CYII=&apos;); background-size: cover; display: block;&quot;
    &gt;
      &lt;img
        class=&quot;gatsby-resp-image-image&quot;
        style=&quot;width: 100%; height: 100%; margin: 0; vertical-align: middle; position: absolute; top: 0; left: 0; box-shadow: inset 0px 0px 0px 400px white;&quot;
        alt=&quot;create-droplet2&quot;
        title=&quot;&quot;
        src=&quot;/static/create-droplet2-8f7f334eb85f8d0d7e05b561abfa6735-fb8a0.png&quot;
        srcset=&quot;/static/create-droplet2-8f7f334eb85f8d0d7e05b561abfa6735-1a291.png 148w,
/static/create-droplet2-8f7f334eb85f8d0d7e05b561abfa6735-2bc4a.png 295w,
/static/create-droplet2-8f7f334eb85f8d0d7e05b561abfa6735-fb8a0.png 590w,
/static/create-droplet2-8f7f334eb85f8d0d7e05b561abfa6735-526de.png 885w,
/static/create-droplet2-8f7f334eb85f8d0d7e05b561abfa6735-fa2eb.png 1180w,
/static/create-droplet2-8f7f334eb85f8d0d7e05b561abfa6735-08f6a.png 1770w,
/static/create-droplet2-8f7f334eb85f8d0d7e05b561abfa6735-a9316.png 2030w&quot;
        sizes=&quot;(max-width: 590px) 100vw, 590px&quot;
      /&gt;
    &lt;/span&gt;
  &lt;/span&gt;
  
  &lt;/a&gt;
    

  &lt;a
    class=&quot;gatsby-resp-image-link&quot;
    href=&quot;/static/create-droplet3-b059ff48d9af7f86b20578b78cc26e44-c0649.png&quot;
    style=&quot;display: block&quot;
    target=&quot;_blank&quot;
    rel=&quot;noopener&quot;
  &gt;
  
  &lt;span
    class=&quot;gatsby-resp-image-wrapper&quot;
    style=&quot;position: relative; display: block; ; max-width: 590px; margin-left: auto; margin-right: auto;&quot;
  &gt;
    &lt;span
      class=&quot;gatsby-resp-image-background-image&quot;
      style=&quot;padding-bottom: 51.24760076775432%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAKCAYAAAC0VX7mAAAACXBIWXMAABYlAAAWJQFJUiTwAAABPElEQVQoz31Sa2+DMAzk//+8fZqmaZvoi7SCBBIgkMfNdltGH6ulU6zIvtzZKbz3qOsaXdfBGAOtNfq+B9+P4/iAaZrAkXMW3EcxzzOapoFSSoi5iSOltODavCa5vcNyFjFGjKxmGERVJIJ13Kg4dz4ozDkJRCFbsLbDQGRNo2HJuiXLnK/Jlua7R9JKQEoZBSfltoLebaX8WBscvr+RY8A8B+x/SrALJklViTQ4aVa7AzSNKFC++fxA+f6GIeJMaE2LQTdS2DuH9nQUCxPNd69OQsyEvSaCyUud0UZqPZFslcHmUMPSvgoZOsslhBAW+ayKcc1FIRUmPlc2+ynB0BsM58kyk8W6QjhupMCNLfb66+lWcbft2w1ftszFs7PwnbkQOlSt+verPN0+/vJCGi6Wr38OGS/+3CuVwC9t7BEdF4GCmwAAAABJRU5ErkJggg==&apos;); background-size: cover; display: block;&quot;
    &gt;
      &lt;img
        class=&quot;gatsby-resp-image-image&quot;
        style=&quot;width: 100%; height: 100%; margin: 0; vertical-align: middle; position: absolute; top: 0; left: 0; box-shadow: inset 0px 0px 0px 400px white;&quot;
        alt=&quot;create-droplet3&quot;
        title=&quot;&quot;
        src=&quot;/static/create-droplet3-b059ff48d9af7f86b20578b78cc26e44-fb8a0.png&quot;
        srcset=&quot;/static/create-droplet3-b059ff48d9af7f86b20578b78cc26e44-1a291.png 148w,
/static/create-droplet3-b059ff48d9af7f86b20578b78cc26e44-2bc4a.png 295w,
/static/create-droplet3-b059ff48d9af7f86b20578b78cc26e44-fb8a0.png 590w,
/static/create-droplet3-b059ff48d9af7f86b20578b78cc26e44-526de.png 885w,
/static/create-droplet3-b059ff48d9af7f86b20578b78cc26e44-fa2eb.png 1180w,
/static/create-droplet3-b059ff48d9af7f86b20578b78cc26e44-08f6a.png 1770w,
/static/create-droplet3-b059ff48d9af7f86b20578b78cc26e44-c0649.png 2084w&quot;
        sizes=&quot;(max-width: 590px) 100vw, 590px&quot;
      /&gt;
    &lt;/span&gt;
  &lt;/span&gt;
  
  &lt;/a&gt;
    

  &lt;a
    class=&quot;gatsby-resp-image-link&quot;
    href=&quot;/static/create-droplet4-b7bc55786f4829f82625c6fb80082052-8f6ff.png&quot;
    style=&quot;display: block&quot;
    target=&quot;_blank&quot;
    rel=&quot;noopener&quot;
  &gt;
  
  &lt;span
    class=&quot;gatsby-resp-image-wrapper&quot;
    style=&quot;position: relative; display: block; ; max-width: 590px; margin-left: auto; margin-right: auto;&quot;
  &gt;
    &lt;span
      class=&quot;gatsby-resp-image-background-image&quot;
      style=&quot;padding-bottom: 52.42334322453017%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAKCAIAAAA7N+mxAAAACXBIWXMAABYlAAAWJQFJUiTwAAABA0lEQVQoz5VQy07DMBD0T3IAeoI/6A/wG0gtElw59neaHlCQQkhinKeTrr3LxKZVEYeW0dra9Xo83lFfAVrrqqrqunbOycVQYKZpWhSF99xabkZprIx0GRmLA2LteQ4+4Ay56zpj6r7v27ZFLv+BwrBF8ZnnH1mWjeMINSLC/MaYsizxXPyCD3AnwKEqjc31ANGh70GmAK1nC0GGI/UBeA4XpmnCbq0FXzkWF4ac9vtZgYUcWzugjHZ4qEbh3x6gVDHDuSMnoeu8NAN+eMYtYYGy/wnhmBB7S0whoWP3T3hh9fC+udo+LpKn22R9jEWyvklW97uXu90zktNWjOvtavn2+g1ZwDZU9IFR3wAAAABJRU5ErkJggg==&apos;); background-size: cover; display: block;&quot;
    &gt;
      &lt;img
        class=&quot;gatsby-resp-image-image&quot;
        style=&quot;width: 100%; height: 100%; margin: 0; vertical-align: middle; position: absolute; top: 0; left: 0; box-shadow: inset 0px 0px 0px 400px white;&quot;
        alt=&quot;create-droplet4&quot;
        title=&quot;&quot;
        src=&quot;/static/create-droplet4-b7bc55786f4829f82625c6fb80082052-fb8a0.png&quot;
        srcset=&quot;/static/create-droplet4-b7bc55786f4829f82625c6fb80082052-1a291.png 148w,
/static/create-droplet4-b7bc55786f4829f82625c6fb80082052-2bc4a.png 295w,
/static/create-droplet4-b7bc55786f4829f82625c6fb80082052-fb8a0.png 590w,
/static/create-droplet4-b7bc55786f4829f82625c6fb80082052-526de.png 885w,
/static/create-droplet4-b7bc55786f4829f82625c6fb80082052-fa2eb.png 1180w,
/static/create-droplet4-b7bc55786f4829f82625c6fb80082052-08f6a.png 1770w,
/static/create-droplet4-b7bc55786f4829f82625c6fb80082052-8f6ff.png 2022w&quot;
        sizes=&quot;(max-width: 590px) 100vw, 590px&quot;
      /&gt;
    &lt;/span&gt;
  &lt;/span&gt;
  
  &lt;/a&gt;
    &lt;/p&gt;
&lt;p&gt;Add your SSH key and create the droplet.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;You need to DELETE the droplet to stop being charged for it. You will still be charged the hourly rate even if you power it down.&lt;/strong&gt;&lt;/p&gt;
&lt;h2&gt;Setup DNS&lt;/h2&gt;
&lt;p&gt;At your domain registrator create &lt;em&gt;A record&lt;/em&gt; pointing to your location. Eg. setting in OnLine DNS:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot;&gt;
      &lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;Name      Adress                TTL
––––––––––––––––––––––––––––––––––––––––––––—–——————
@         droplet_ip_address    900
*         droplet_ip_address    900&lt;/code&gt;&lt;/pre&gt;
      &lt;/div&gt;
&lt;h2&gt;Set up Dokku Droplet&lt;/h2&gt;
&lt;p&gt;Navigate to domain you’ve setup in the previous step&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Note: If did setup DNS record recently it may take some time to propagate changes.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;
  &lt;a
    class=&quot;gatsby-resp-image-link&quot;
    href=&quot;/static/dokku-setup-2204103ffeb1603421475dd1f4888ba4-e4512.png&quot;
    style=&quot;display: block&quot;
    target=&quot;_blank&quot;
    rel=&quot;noopener&quot;
  &gt;
  
  &lt;span
    class=&quot;gatsby-resp-image-wrapper&quot;
    style=&quot;position: relative; display: block; ; max-width: 590px; margin-left: auto; margin-right: auto;&quot;
  &gt;
    &lt;span
      class=&quot;gatsby-resp-image-background-image&quot;
      style=&quot;padding-bottom: 88.2716049382716%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAASCAYAAABb0P4QAAAACXBIWXMAABYlAAAWJQFJUiTwAAAB/klEQVQ4y6VTy47aQBCcL885X5FrpJxyySlSLjlEuYDATx7maWwMBhswmIehMtXrWa2QkmU3I5V6uqfdU9NdVrPZDI1GA81mE2EYwnEctNtt+L6PLMtwOBxQliW4brcbXlsqTVO4risFBoMBxuMx+v2+FGbBoiikqCn4GhST1+s1drsdTqfTX29+pJgwzPNcGCVJIoHr9fqM++T7wvcxfqMu5zNGoxHiOMZmsxG2y+USbAUvoaW/WCwEq9VKcghzZvzL5QLFZw6HQ/R6PQRBIJYXcM+e9utYoF9Bn/tOpyOWvonRFvs91PF4hG3bAiZ6nicDot/tdgVmz3jHZ44PVw+NPuMcIO1OD1AYUjpRFAk4ZcpnOp2K5Rn3M30m+8lE/Im2zI3qOFt21u2TgqRstS1hwtvJlLc69pMm2zyzLPEdndNqtepct47bWnqeyExVVSWSYVPZcAY5eQ5or3tCUIu0lJjRJcVuzunTsn2KH5K+mRITmUD671mK7Dgh9mK73T6Lm5oi+7dCkZV5CtmSNg8Yp30p9Eeg8iwXAcfzubDktGjn2mdf3vHkAuFMjz6KddFEis+1ZQ9fMn0EwrA6lSjWCcpNimwRifbIblLrzfySbMm/wFmwdcoOt/j8a4ovv0N8t+aoNCOyIzODNzH84aX48LWHj98CfPoZ4n/XH6iqW1TJdrA0AAAAAElFTkSuQmCC&apos;); background-size: cover; display: block;&quot;
    &gt;
      &lt;img
        class=&quot;gatsby-resp-image-image&quot;
        style=&quot;width: 100%; height: 100%; margin: 0; vertical-align: middle; position: absolute; top: 0; left: 0; box-shadow: inset 0px 0px 0px 400px white;&quot;
        alt=&quot;dokku-setup&quot;
        title=&quot;&quot;
        src=&quot;/static/dokku-setup-2204103ffeb1603421475dd1f4888ba4-fb8a0.png&quot;
        srcset=&quot;/static/dokku-setup-2204103ffeb1603421475dd1f4888ba4-1a291.png 148w,
/static/dokku-setup-2204103ffeb1603421475dd1f4888ba4-2bc4a.png 295w,
/static/dokku-setup-2204103ffeb1603421475dd1f4888ba4-fb8a0.png 590w,
/static/dokku-setup-2204103ffeb1603421475dd1f4888ba4-526de.png 885w,
/static/dokku-setup-2204103ffeb1603421475dd1f4888ba4-fa2eb.png 1180w,
/static/dokku-setup-2204103ffeb1603421475dd1f4888ba4-e4512.png 1296w&quot;
        sizes=&quot;(max-width: 590px) 100vw, 590px&quot;
      /&gt;
    &lt;/span&gt;
  &lt;/span&gt;
  
  &lt;/a&gt;
    &lt;/p&gt;
&lt;p&gt;Check option “Use virtualhost naming for apps”. It will allow you to access apps in the following manner.&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot;&gt;
      &lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;http://myapp.your-domain.com&lt;/code&gt;&lt;/pre&gt;
      &lt;/div&gt;
&lt;p&gt;Click “Finish Setup”.&lt;/p&gt;
&lt;p&gt;Now &lt;code class=&quot;language-text&quot;&gt;ssh&lt;/code&gt; into your machine and execute following steps before your deploy apps to settup proper server locale.&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot;&gt;
      &lt;pre class=&quot;language-bash&quot;&gt;&lt;code class=&quot;language-bash&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&apos;LANG=en_US.UTF-8&apos;&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;&gt;&lt;/span&gt; /etc/default/locale
&lt;span class=&quot;token keyword&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&apos;LC_ALL=en_US.UTF-8&apos;&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;&gt;&gt;&lt;/span&gt; /etc/default/locale
&lt;span class=&quot;token function&quot;&gt;sudo&lt;/span&gt; locale-gen en_US en_US.UTF-8
&lt;span class=&quot;token function&quot;&gt;reboot&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
      &lt;/div&gt;
&lt;h2&gt;Creating application&lt;/h2&gt;
&lt;p&gt;Now create &lt;a href=&quot;http://expressjs.com&quot;&gt;express&lt;/a&gt; application using &lt;a href=&quot;http://expressjs.com/en/starter/generator.html&quot;&gt;generator&lt;/a&gt;.&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot;&gt;
      &lt;pre class=&quot;language-bash&quot;&gt;&lt;code class=&quot;language-bash&quot;&gt;express --view&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;pug myapp&lt;/code&gt;&lt;/pre&gt;
      &lt;/div&gt;
&lt;p&gt;Navigate to project directory&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot;&gt;
      &lt;pre class=&quot;language-bash&quot;&gt;&lt;code class=&quot;language-bash&quot;&gt;&lt;span class=&quot;token function&quot;&gt;cd&lt;/span&gt; myapp&lt;/code&gt;&lt;/pre&gt;
      &lt;/div&gt;
&lt;p&gt;Create Procfile to launch application.&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot;&gt;
      &lt;pre class=&quot;language-bash&quot;&gt;&lt;code class=&quot;language-bash&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;web: node ./bin/www&quot;&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;&gt;&lt;/span&gt; Procfile&lt;/code&gt;&lt;/pre&gt;
      &lt;/div&gt;
&lt;p&gt;Now, our application is created and we can deploy to the Dokku server.&lt;/p&gt;
&lt;h2&gt;Deploying to Dokku&lt;/h2&gt;
&lt;p&gt;Deploying to Dokku is really simple. We just need to &lt;code class=&quot;language-text&quot;&gt;git push&lt;/code&gt; to a particular remote. In your terminal, type:&lt;/p&gt;
&lt;p&gt;Next, create a new file called .gitignore and add:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot;&gt;
      &lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;node_modules&lt;/code&gt;&lt;/pre&gt;
      &lt;/div&gt;
&lt;p&gt;This makes sure we don’t copy those with our code unnecessarily, as Dokku will install any dependencies that are needed. Now, back in your terminal, type the following commands:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot;&gt;
      &lt;pre class=&quot;language-bash&quot;&gt;&lt;code class=&quot;language-bash&quot;&gt;&lt;span class=&quot;token function&quot;&gt;git&lt;/span&gt; init &lt;span class=&quot;token operator&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;git&lt;/span&gt; add --all &lt;span class=&quot;token operator&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;git&lt;/span&gt; commit -m &lt;span class=&quot;token string&quot;&gt;&quot;Initial commit&quot;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
      &lt;/div&gt;
&lt;p&gt;First, first command makes project a Git repository. Following commands adds all changes.&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot;&gt;
      &lt;pre class=&quot;language-bash&quot;&gt;&lt;code class=&quot;language-bash&quot;&gt;&lt;span class=&quot;token function&quot;&gt;git&lt;/span&gt; remote add dokku dokku@your-domain.com:myapp&lt;/code&gt;&lt;/pre&gt;
      &lt;/div&gt;
&lt;p&gt;Next we add a remote called dokku at the location &lt;code class=&quot;language-text&quot;&gt;dokku@your-domain.com:myapp&lt;/code&gt;. The &lt;code class=&quot;language-text&quot;&gt;:myapp&lt;/code&gt; is the name of our app. Remember when I mentioned multiple apps on the same server, that’s where the app name is important.&lt;/p&gt;
&lt;p&gt;Now, to deploy, we simply push our code to the Dokku server:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot;&gt;
      &lt;pre class=&quot;language-bash&quot;&gt;&lt;code class=&quot;language-bash&quot;&gt;&lt;span class=&quot;token function&quot;&gt;git&lt;/span&gt; push dokku master&lt;/code&gt;&lt;/pre&gt;
      &lt;/div&gt;
&lt;p&gt;Wait a minute or so, read the output:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot;&gt;
      &lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;...
-----&amp;gt; Releasing myapp ...

-----&amp;gt; Deploying myapp ...
-----&amp;gt; Cleaning up ...
=====&amp;gt; Application deployed:
       http://myapp.your-domain.com

To dokku@your-domain.com:myapp&lt;/code&gt;&lt;/pre&gt;
      &lt;/div&gt;
&lt;p&gt;Then we can hit our URL and get our site!&lt;/p&gt;
&lt;p&gt;Please feel free to comment and share!&lt;/p&gt;</content:encoded></item></channel></rss>