<?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: aaftabkhan</title>
    <description>The latest articles on DEV Community by aaftabkhan (@aaftabkhan).</description>
    <link>https://dev.to/aaftabkhan</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%2F321967%2Fc813e602-b747-4c32-9e0b-3359372d06f1.jpeg</url>
      <title>DEV Community: aaftabkhan</title>
      <link>https://dev.to/aaftabkhan</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/aaftabkhan"/>
    <language>en</language>
    <item>
      <title>Hosting your own blog using Ghost CMS (an excellent alternative to WordPress)</title>
      <dc:creator>aaftabkhan</dc:creator>
      <pubDate>Sun, 26 Apr 2020 13:06:22 +0000</pubDate>
      <link>https://dev.to/aaftabkhan/hosting-your-own-blog-using-ghost-cms-an-excellent-alternative-to-wordpress-4nfi</link>
      <guid>https://dev.to/aaftabkhan/hosting-your-own-blog-using-ghost-cms-an-excellent-alternative-to-wordpress-4nfi</guid>
      <description>&lt;p&gt;For a long time now I was planning to host my own tech blog, but managing multiple WordPress blog over the years I was sure of one thing that it is not going to be my CMS for sure.&lt;/p&gt;

&lt;p&gt;I played with Hugo (an open-source static site generators) &amp;amp; Ghost for sometime and ultimately ended up choosing Ghost for my blog.&lt;/p&gt;

&lt;p&gt;Sure!, there are some pros and cons with both of them and the first one would be, hosting cost. As being a static site Hugo will be much cheaper to host compared to Ghost which is a platform built on a modern Node.js technology stack.&lt;/p&gt;

&lt;p&gt;Let me give you a complete walkthrough of the entire setup.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;To follow this tutorial, you will need the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Your own domain name.&lt;/li&gt;
&lt;li&gt;A Linux server.&lt;/li&gt;
&lt;li&gt;Domain mapped to your Linux server IP.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;My preferred linux server is AWS EC2.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;AWS offers free-tire for new users where you'll get a t2-micro(1 vCPU &amp;amp; 1 GB Memory) instance free for a year.  &lt;/p&gt;

&lt;p&gt;Which is more than enough for a new blog.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Step 1- Install Nginx webserver
&lt;/h2&gt;

&lt;p&gt;First, update your existing list of packages:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sudo apt-get update&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Next, install Nginx&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sudo apt-get install nginx -y&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2- Install MySQL Server
&lt;/h2&gt;

&lt;p&gt;Ghost CMS uses MySQL as its backbone database.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;MySQL 5.5, 5.6, or 5.7 (not &amp;gt;= 8.0)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;code&gt;sudo apt-get install mysql-server -y&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3- Configure MySQL
&lt;/h2&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# To set a password, run
sudo mysql

# Now update your user with this password
# Replace 'password' with your password, but keep the quote marks!
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';

# Then exit MySQL
quit

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



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

&lt;p&gt;&lt;code&gt;curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sudo apt-get install -y nodejs&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5- Install Ghost
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;sudo npm install ghost-cli@latest -g&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 6- Create a directory for Ghost
&lt;/h2&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# We'll name ours 'ghost' in this example; you can use whatever you want
sudo mkdir -p /var/www/ghost

# Replace &amp;lt;user&amp;gt; with the name of your user who will own this directory
sudo chown &amp;lt;user&amp;gt;:&amp;lt;user&amp;gt; /var/www/ghost

# Set the correct permissions
sudo chmod 775 /var/www/ghost

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 7- Run Ghost
&lt;/h2&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Navigate into it
cd /var/www/ghost

ghost install

##It will prompt you for some inputs

# Enter your blog URL, for our example we will use foobar.com
# In case you want your blog on a subdomain, enter &amp;lt;subdomain.foobar.com&amp;gt; (Make sure subdomain is mapped to IP address of server)

? Enter your blog URL: foobar.com

? Enter your MySQL hostname: localhost 
#Since our MySQL is installed on same server its localhost

? Enter your MySQL username: root

? Enter your MySQL password: [password]
#your root password created in Step 3

? Enter your Ghost database name: ghost_prod

? Do you wish to set up "ghost" mysql user? No 

? Do you wish to set up Nginx? Yes

? Do you wish to set up SSL? Yes

? Enter your email (For SSL Certificate): your_email_address

? Do you wish to set up Systemd? Yes

? Do you want to start Ghost? Yes

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Congratulation...&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Your blog is up and running&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/14cDsqOkks6O8U/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/14cDsqOkks6O8U/giphy.gif" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Visit https:///ghost/ to setup your admin user.&lt;/p&gt;

</description>
      <category>writing</category>
      <category>blogging</category>
      <category>linux</category>
    </item>
  </channel>
</rss>
