<?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: Alex Kuang</title>
    <description>The latest articles on DEV Community by Alex Kuang (@alexkuang0).</description>
    <link>https://dev.to/alexkuang0</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%2F183236%2F431f32b4-be95-45d5-b221-fd0646cd623b.jpg</url>
      <title>DEV Community: Alex Kuang</title>
      <link>https://dev.to/alexkuang0</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/alexkuang0"/>
    <language>en</language>
    <item>
      <title>Install Ghost with Caddy on Ubuntu</title>
      <dc:creator>Alex Kuang</dc:creator>
      <pubDate>Sat, 14 Dec 2019 05:08:23 +0000</pubDate>
      <link>https://dev.to/alexkuang0/install-ghost-with-caddy-on-ubuntu-3flf</link>
      <guid>https://dev.to/alexkuang0/install-ghost-with-caddy-on-ubuntu-3flf</guid>
      <description>&lt;h2&gt;
  
  
  TL; DR
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Get a server with Ubuntu up and running&lt;/li&gt;
&lt;li&gt;Set up a non-root user and add it to superuser group&lt;/li&gt;
&lt;li&gt;Install MySQL and Node.js&lt;/li&gt;
&lt;li&gt;Install Ghost-CLI and start&lt;/li&gt;
&lt;li&gt;Install Caddy as a service and write a simple Caddyfile&lt;/li&gt;
&lt;li&gt;Get everything up and running!&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Foreword (Feel-Free-to-Ignore-My-Nonsense™️)
&lt;/h2&gt;

&lt;p&gt;This article is about how I built &lt;strong&gt;this&lt;/strong&gt; blog with Ghost, an open-source blog platform based on Node.js. I used to use WordPress and static website generators like Hexo and Jekyll for my blog. But they turned out either too heavy or too light. Ghost seems like a perfect balance between them. It's open source; it's elegant out-of-the-box. Zero configuration is required; yet it's configurable from top to bottom. &lt;/p&gt;

&lt;p&gt;The Ghost project is actually very well-documented – it has a decent &lt;a href="https://ghost.org/docs/install/ubuntu"&gt;official installation guide&lt;/a&gt; on Ubuntu with Nginx. But as you can see from the title of this article, I am going to ship it together with my favorite web server – Caddy! It's a lightweight, easy to configure yet powerful web server. To someone like me, who hate to write or read either Nginx &lt;code&gt;conf&lt;/code&gt; files or Apache &lt;code&gt;.htaccess&lt;/code&gt; files, Caddy is like an oasis in the desert of tedious web server configurations. &lt;/p&gt;

&lt;p&gt;The web technologies are changing rapidly, especially for open source projects like Ghost and Caddy. From my observation, I would say neither Ghost nor Caddy are going to be backward compatible, which means the newer version of the software may not work as expected in older environment. So I &lt;strong&gt;recommend&lt;/strong&gt; that you should always check if this tutorial is outdated or deprecated before moving on. You can go to their official website by clicking their names in the next section. Also,  if you are running the application in production, use a fixed version, preferably with LTS (&lt;em&gt;Long-term support&lt;/em&gt;).&lt;/p&gt;

&lt;h2&gt;
  
  
  Environments and Softwares
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://ubuntu.com/download/server"&gt;Ubuntu 18.04.3 LTS&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://nodejs.org/en/about/releases/"&gt;Node.js v10.17.0 LTS&lt;/a&gt; (This is the highest version Ghost support as of Dec. 2019)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://caddyserver.com/v1/"&gt;Caddy 1&lt;/a&gt; (&lt;strong&gt;NOT&lt;/strong&gt; Caddy 2, which is still in &lt;strong&gt;beta&lt;/strong&gt; as of Dec. 2019)&lt;/li&gt;
&lt;li&gt;MySQL 5.7 (It's gonna consume &lt;strong&gt;A LOT&lt;/strong&gt; of memory! Use a lower version if you're running on a server with &amp;lt;1GB RAM.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let get started! 👨‍💻👩‍💻&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Get a server
&lt;/h2&gt;

&lt;p&gt;Get a server with Ubuntu up and running! Almost every cloud hosting company will provide Ubuntu 18.04 LTS image as of now.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Set up a non-root superuser
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# connect with root credentials to the server&lt;/span&gt;
ssh root@&amp;lt;server_ip&amp;gt; &lt;span class="nt"&gt;-p&lt;/span&gt; &amp;lt;ssh_port&amp;gt; &lt;span class="c"&gt;# Default port: 22&lt;/span&gt;

&lt;span class="c"&gt;# create a new user&lt;/span&gt;
adduser &amp;lt;username&amp;gt;

&lt;span class="c"&gt;# add that user to superuser group&lt;/span&gt;
usermod &lt;span class="nt"&gt;-aG&lt;/span&gt; &lt;span class="nb"&gt;sudo&lt;/span&gt; &amp;lt;username&amp;gt;

&lt;span class="c"&gt;# login as the new user&lt;/span&gt;
su &amp;lt;username&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 3: Install MySQL and set up
&lt;/h2&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;apt update
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt upgrade

&lt;span class="c"&gt;# install MySQL&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;mysql-server

&lt;span class="c"&gt;# Set up MySQL password, it's required on Ubuntu 18.04!&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;mysql

&lt;span class="c"&gt;# Replace 'password' with your password, but keep the quote marks!&lt;/span&gt;
ALTER USER &lt;span class="s1"&gt;'root'&lt;/span&gt;@&lt;span class="s1"&gt;'localhost'&lt;/span&gt; IDENTIFIED WITH mysql_native_password BY &lt;span class="s1"&gt;'password'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c"&gt;# Then exit MySQL&lt;/span&gt;
quit
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 4: Install Node.js
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Method 1: Use apt / apt-get
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-sL&lt;/span&gt; https://deb.nodesource.com/setup_10.x | &lt;span class="nb"&gt;sudo&lt;/span&gt; &lt;span class="nt"&gt;-E&lt;/span&gt; bash
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt-get &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-y&lt;/span&gt; nodejs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Method 2: Use nvm (Node Version Manager)
&lt;/h3&gt;

&lt;p&gt;to facilitate switching between Node.js versions&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-o-&lt;/span&gt; https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.1/install.sh | bash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The script clones the nvm repository to &lt;code&gt;~/.nvm&lt;/code&gt;, and adds the source lines from the snippet below to your profile (&lt;code&gt;~/.bash_profile&lt;/code&gt;, &lt;code&gt;~/.zshrc&lt;/code&gt;, &lt;code&gt;~/.profile&lt;/code&gt;, or &lt;code&gt;~/.bashrc&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;&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;NVM_DIR&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="nt"&gt;-z&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;XDG_CONFIG_HOME&lt;/span&gt;&lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;printf&lt;/span&gt; %s &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;HOME&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;/.nvm"&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nb"&gt;printf&lt;/span&gt; %s &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;XDG_CONFIG_HOME&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;/nvm"&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="nt"&gt;-s&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$NVM_DIR&lt;/span&gt;&lt;span class="s2"&gt;/nvm.sh"&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="se"&gt;\.&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$NVM_DIR&lt;/span&gt;&lt;span class="s2"&gt;/nvm.sh"&lt;/span&gt; &lt;span class="c"&gt;# This loads nvm&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Install Node.js v10.17.0&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;# source profile&lt;/span&gt;
&lt;span class="nb"&gt;source&lt;/span&gt; ~/.bash_profile  &lt;span class="c"&gt;# change to your profile&lt;/span&gt;

&lt;span class="c"&gt;# check if nvm is properly installed&lt;/span&gt;
&lt;span class="nb"&gt;command&lt;/span&gt; &lt;span class="nt"&gt;-v&lt;/span&gt; nvm  &lt;span class="c"&gt;# output will be `nvm` if it is&lt;/span&gt;

nvm &lt;span class="nb"&gt;install &lt;/span&gt;v10.17.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 4: Install Ghost-CLI
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Method 1: Use npm
&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;npm &lt;span class="nb"&gt;install &lt;/span&gt;ghost-cli@latest &lt;span class="nt"&gt;-g&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Method 2: Use yarn
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# install yarn if you don't have it&lt;/span&gt;
curl &lt;span class="nt"&gt;-sS&lt;/span&gt; https://dl.yarnpkg.com/debian/pubkey.gpg | &lt;span class="nb"&gt;sudo &lt;/span&gt;apt-key add -
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"deb https://dl.yarnpkg.com/debian/ stable main"&lt;/span&gt; | &lt;span class="nb"&gt;sudo tee&lt;/span&gt; /etc/apt/sources.list.d/yarn.list
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt update &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;yarn

&lt;span class="nb"&gt;sudo &lt;/span&gt;yarn global add ghost-cli@latest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 5: Get Ghost up and running
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;    &lt;span class="nb"&gt;sudo mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; /var/www/ghost
    &lt;span class="nb"&gt;sudo chown&lt;/span&gt; &amp;lt;username&amp;gt;:&amp;lt;username&amp;gt; /var/www/ghost
    &lt;span class="nb"&gt;sudo chmod &lt;/span&gt;775 /var/www/ghost
    &lt;span class="nb"&gt;cd&lt;/span&gt; /var/www/ghost
    ghost &lt;span class="nb"&gt;install&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Install questions
&lt;/h3&gt;

&lt;p&gt;During install, the CLI will ask a number of questions to configure your site. They will probably throw an error or two about you don't have Nginx installed. Just ignore that.&lt;/p&gt;

&lt;h4&gt;
  
  
  Blog URL
&lt;/h4&gt;

&lt;p&gt;Enter the exact URL your publication will be available at and include the protocol for HTTP or HTTPS. For example, &lt;code&gt;https://example.com&lt;/code&gt;.&lt;/p&gt;

&lt;h4&gt;
  
  
  MySQL hostname
&lt;/h4&gt;

&lt;p&gt;This determines where your MySQL database can be accessed from. When MySQL is installed on the same server, use &lt;code&gt;localhost&lt;/code&gt; (press Enter to use the default value). If MySQL is installed on another server, enter the name manually.&lt;/p&gt;

&lt;h4&gt;
  
  
  MySQL username / password
&lt;/h4&gt;

&lt;p&gt;If you already have an existing MySQL database enter the the username. Otherwise, enter &lt;code&gt;root&lt;/code&gt;. Then supply the password for your user.&lt;/p&gt;

&lt;h4&gt;
  
  
  Ghost database name
&lt;/h4&gt;

&lt;p&gt;Enter the name of your database. It will be automatically set up for you, unless you're using a &lt;strong&gt;non&lt;/strong&gt;-root MySQL user/pass. In that case the database must already exist and have the correct permissions.&lt;/p&gt;

&lt;h4&gt;
  
  
  Set up a ghost MySQL user? (Recommended)
&lt;/h4&gt;

&lt;p&gt;If you provided your root MySQL user, Ghost-CLI can create a custom MySQL user that can only access/edit your new Ghost database and nothing else.&lt;/p&gt;

&lt;h4&gt;
  
  
  Set up systemd? (Recommended)
&lt;/h4&gt;

&lt;p&gt;&lt;code&gt;systemd&lt;/code&gt; is the recommended process manager tool to keep Ghost running smoothly. We recommend choosing &lt;code&gt;yes&lt;/code&gt; but it’s possible to set up your own process management.&lt;/p&gt;

&lt;h4&gt;
  
  
  Start Ghost?
&lt;/h4&gt;

&lt;p&gt;Choosing &lt;code&gt;yes&lt;/code&gt; runs Ghost on default port &lt;code&gt;2368&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 6: Get Caddy up and running
&lt;/h2&gt;

&lt;p&gt;Caddy has an awesome collection of plugins. You can go to &lt;a href="https://caddyserver.com/v1/download"&gt;Download Caddy&lt;/a&gt; page. First, select the correct platform; then add a bunch of plugins that you're interested. After that, don't click &lt;code&gt;Download&lt;/code&gt;. Copy the link in the &lt;code&gt;Direct link to download&lt;/code&gt; section. Head back to ssh in terminal.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--18J6LxPT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://blog.alex0.dev/content/images/2019/12/Screenshot_2019-12-13_03-17-32.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--18J6LxPT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://blog.alex0.dev/content/images/2019/12/Screenshot_2019-12-13_03-17-32.png" alt=""&gt;&lt;/a&gt;&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;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; ~/Downloads
&lt;span class="nb"&gt;cd&lt;/span&gt; ~/Downloads

&lt;span class="c"&gt;# download caddy binary, the link may differ if you added plugins&lt;/span&gt;
curl https://caddyserver.com/download/linux/amd64?license&lt;span class="o"&gt;=&lt;/span&gt;personal&amp;amp;telemetry&lt;span class="o"&gt;=&lt;/span&gt;off &lt;span class="nt"&gt;--output&lt;/span&gt; caddy
&lt;span class="nb"&gt;sudo cp&lt;/span&gt; ./caddy /usr/local/bin
&lt;span class="nb"&gt;sudo chown &lt;/span&gt;root:root /usr/local/bin/caddy
&lt;span class="nb"&gt;sudo chmod &lt;/span&gt;755 /usr/local/bin/caddy

&lt;span class="nb"&gt;sudo &lt;/span&gt;setcap &lt;span class="s1"&gt;'cap_net_bind_service=+ep'&lt;/span&gt; /usr/local/bin/caddy

&lt;span class="nb"&gt;sudo mkdir&lt;/span&gt; /etc/caddy
&lt;span class="nb"&gt;sudo chown&lt;/span&gt; &lt;span class="nt"&gt;-R&lt;/span&gt; root:root /etc/caddy
&lt;span class="nb"&gt;sudo mkdir&lt;/span&gt; /etc/ssl/caddy
&lt;span class="nb"&gt;sudo chown&lt;/span&gt; &lt;span class="nt"&gt;-R&lt;/span&gt; root:&amp;lt;username&amp;gt; /etc/ssl/caddy
&lt;span class="nb"&gt;sudo chmod &lt;/span&gt;770 /etc/ssl/caddy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Run Caddy as a service
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;wget https://raw.githubusercontent.com/caddyserver/caddy/master/dist/init/linux-systemd/caddy.service
&lt;span class="nb"&gt;sudo cp &lt;/span&gt;caddy.service /etc/systemd/system/
&lt;span class="nb"&gt;sudo chown &lt;/span&gt;root:root /etc/systemd/system/caddy.service
&lt;span class="nb"&gt;sudo chmod &lt;/span&gt;644 /etc/systemd/system/caddy.service
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl daemon-reload
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl start caddy.service
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl &lt;span class="nb"&gt;enable &lt;/span&gt;caddy.service
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Create &lt;code&gt;Caddyfile&lt;/code&gt;
&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 touch&lt;/span&gt; /etc/caddy/Caddyfile
&lt;span class="nb"&gt;sudo chown &lt;/span&gt;root:root /etc/caddy/Caddyfile
&lt;span class="nb"&gt;sudo chmod &lt;/span&gt;644 /etc/caddy/Caddyfile

&lt;span class="nb"&gt;sudo &lt;/span&gt;vi /etc/caddy/Caddyfile    &lt;span class="c"&gt;# edit Caddyfile with your preferred editor, here I use vi&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We're gonna set up a simple reverse proxy to Ghost's port (2368). Here are 2 sample &lt;code&gt;Caddyfile&lt;/code&gt;s respectively for Auto SSL enabled and disabled.&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;# auto ssl&lt;/span&gt;
example.com, www.example.com &lt;span class="o"&gt;{&lt;/span&gt;
    proxy / 127.0.0.1:2368
    tls admin@example.com
&lt;span class="o"&gt;}&lt;/span&gt;

&lt;span class="c"&gt;# no auto ssl&lt;/span&gt;
http://example.com, http://www.example.com &lt;span class="o"&gt;{&lt;/span&gt;
    proxy / 127.0.0.1:2368
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you want Auto SSL issued by Let's Encrypt, you should put your email after the &lt;code&gt;tls&lt;/code&gt; directive on the 3rd line; otherwise, use the second part of this &lt;code&gt;Caddyfile&lt;/code&gt;. (For me, I was using Cloudflare flexible Auto SSL mode, so I just built a reverse proxy based on HTTP protocol only here)&lt;/p&gt;

&lt;h3&gt;
  
  
  Fire it up 🔥
&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;systemctl start caddy.service
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://ghost.org/docs/install/ubuntu/#overview"&gt;https://ghost.org/docs/install/ubuntu&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/caddyserver/caddy/tree/master/dist/init/linux-systemd"&gt;https://github.com/caddyserver/caddy/tree/master/dist/init/linux-systemd&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/nvm-sh/nvm"&gt;https://github.com/nvm-sh/nvm&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ubuntu</category>
      <category>node</category>
    </item>
  </channel>
</rss>
