4 minutes
Getting a Ghost Site up Quick
I finally got my blog up and running. I am finally so happy. Spent a lot of time on the animations with the Blinking Cursor and the name.
This site runs Ghost on Amazon LightSail. What I will discuss is how I set up the DNS routes, SSL, developed the CSS, and running Ghost Locally. Still working on the SSL, because there are issues with mixed content (http, and https).
It has been a big goal of mine to start something that I can use to share knowledge, so this is my way of reaching out.
Setup, Routing, and SSL
I got this website up and running on Amazon LightSail. Created an instance with Ghost attached, costing $3.50 a month.
To get started, you need to access the bitnami instance through ssh and get the email and password of the current user. Use this command to get it sudo cat /home/bitnami/bitnami_credentials
resource here. You can then enter the ghost site at the following URL http://<ip-address>/ghost
.
To get SSL, I created a Static IP address for the site. I had to register a Domain with Route 53. I then created an Alias to the static IP address of the server for both www.<domain-name>
and <domain-name>
. For instance, I created A records for www.byteofcode.io and www.byteofcode.io to 44.193.192.18.
I then used Lets Encrypt to secure the domain byteofcode.io
with https. Follow this link for instructions to do this on bitnami. Basically just run the command sudo /opt/bitnami/bncert-tool
.
CSS and HTML for Ghost
I then want to add some CSS and HTML to the instance. I needed to download Ghost from npm. If you are using a M1 silicone computer like me, use node V14.17.0 or higher, and install ghost globally. This can be managed using the nvm
node version manager, just make sure you use ^v14.17 if using M1 silicone machines nvm use v14.17.0
npm install -g ghost
ghost install local
ghost start --development
For me the site was hosted on localhost at http://localhost:2368/ghost/#/site. I could make changes to the CSS and HTML automatically, but anything related to SASS had to be built and the ghost server had to be restarted to show the changes.
to stop the local instance
ghost stop
Since Ghost has themes associated with it, I chose Massively as my base theme. I got this from https://github.com/TryGhost/Massively. I then git clone
the repo. I moved all the files I cloned into the root directory of the ghost local deployment I had at content/themes/<themeName>
. Stop and restart the deployment again.
I was able to change the theme by going to /ghost/#/settings/theme
and selecting the new theme.
I had some issues with the Massively theme, because it used SASS. I had to compile the packages in the theme’s root directory. To compile the SASS, I had to use nodesass
. I have to install gulp nodesass
globally in npm to compile the SASS. If you are using a different theme, check out the package.json
of the theme to get an idea of the packages needed for building the theme to serve in ghost. You might have to restart the ghost server.
For Massively the theme zip file was built using npm run zip
, I could change the SASS and then have the SASS built. I had to restart the ghost server to run the new configurations. ghost stop
and then ghost start --development
.
It was helpful to have a list of SASS changes ready for each iteration.
If you need to backup your information you can click on this resource. Use this information to backup your application if you need to.
I was able to add in Disqus here
Hope you find this information helpful, and leave a comment below if you find it helpful, or just link back to this post.
Thanks 😊, Jake Cukjati Byte of Code
Light Sail Create a Distribution Certificate Ghost Docs Bitnami Ghost Instance Docs
P.S.
To tell you the truth, bitnami crashed on me when I upgraded ghost to version 4. I then did not know what to do, so I had to create a new instance in light sail, and redo everything… Did not take that long.
I hope that Byte of Code at least for me becomes a thing I can look back on and enjoy the times I made things and helped people. Let’s see where the journey goes.
728 Words
2021-09-12 02:15