Install Ghost on Laravel Forge

Discover how to install Ghost.org on Laravel Forge for a robust blogging platform. Ideal for developers, this guide covers everything from SSL setup to Nginx configuration, streamlining your path to a successful Ghost-powered site.

Install Ghost on Laravel Forge
Installing Ghost.org on Forge Laravel

In May I discovered that I had been awarded a $2,500 OpenAI + Microsoft for Startups grant! This award was a welcomed surprise. I had been thinking about how I could improve my daily prayer and meditation routines. Back in late 2003, early 2004 I met the author Phyllis Tickle and helped convert her books, The Divine Hours from an analog form to a daily webpage which made the prayer guide accessible for thousands. So with this grant in hand, I had an idea, could I make a daily prayer meditation tool with AI. I got to work and launched Prayetic.com on May 24, 2023 to a small group of interested Twitter followers.

As I got to work on the application, I realized I would need some support resources like a home page for the application and a blog to share insights, meditations, images, and prayers. Instead of doing the standard developer trap of trying to build it myself, I reached for Ghost.org which is an excellent and free blogging and newsletter platform. But the catch was I'm developing in PHP using the Laravel framework. I wanted my three sites to be on one VPS and I wanted it managed by Laravel Forge. I'm happy to report you can host your home page using a Tailwind React Template, your blog with Ghost.org, and your application in Laravel.

Here's how I did it.

In May, I was thrilled to find out that I had been awarded a $2,500 grant from OpenAI + Microsoft for Startups. This grant came as a delightful surprise, giving me an opportunity to refine and augment my daily prayer and meditation routines.

I recall the period around late 2003 and early 2004 when I had the privilege of meeting author Phyllis Tickle. I assisted in the digitization of her books, The Divine Hour, converting them from traditional print to a daily webpage format. This effort made the prayer guide accessible to thousands of people. With the new grant, a question sparked in my mind: could I leverage AI to create a daily prayer and meditation tool?

Motivated by this thought, I plunged into work, launching Prayetic.com on May 24, 2023, for a keen group of Twitter followers.

As the application started taking shape, I realized I would need additional resources for marketing and distributing my application – a home page for the application, and a blog to share insights, meditations, images, and prayers. Steering clear of the typical developer pitfall of trying to do everything myself and build my own Content Management System (CMS), I turned to Ghost.org, an exceptional, free blogging, content management, and newsletter platform.

The challenge here was the fact that I was developing in PHP using the Laravel framework. I wanted my three sites to be on one Virtual Private Server (VPS), with Laravel Forge managing it all. Fortunately, I found that it's entirely possible to host your home page using a Tailwind React Template, run your blog with Ghost.org, and manage your custom application developed in Laravel.

In the following section, I will explain exactly how I achieved this.

While there are resources around for installing Ghost on Laravel Forge, it's two years old and the pace of change I feared that resource was out of date and would fail and I would be stuck.

But I figured it out.

Here are the detailed steps for installing Ghost.org blog platform on Laravel Forge.

Prerequisites:

Before we begin, ensure you have:

Step 1: Create a New Site on Laravel Forge

  1. Log in to your Laravel Forge account.
  2. Navigate to "Sites" and click "Create Site".
  3. Under "Project Type," select "HTML/Nuxt.js/Next.js".
  4. Name your site. For this example, we'll use blog.domain.com.
  5. Once the site is created, add SSL using Forge’s Let's Encrypt integration. Forge will automatically generate and install an SSL certificate for your site.

Step 2: SSH Into Your New Site

With your site set up and SSL configured, the next step is to SSH into your new site:

  1. Use the SSH details provided by Forge to securely connect to your site’s server.

Step 3: Install Ghost

Forge comes pre-equipped with the necessary tools, so you can start the Ghost installation:

  1. cd into the new site cd blog.example.com
  2. Delete anything in the folder/site rm -rf *
  3. Run sudo npm install ghost-cli@latest -g to install the latest Ghost CLI. (Refer to Ghost CLI Documentation for more details.)
  4. Follow the on-screen prompts to complete the Ghost installation.

Step 4: Configure Nginx for Ghost

After installing Ghost, you need to tweak the Nginx configuration:

  1. In your Forge dashboard, navigate to the server and site you have created.
  2. Under the site settings, find and edit the Nginx configuration.
  3. Modify the configuration to suit Ghost’s requirements (Consult the Ghost Documentation for specific Nginx configurations for Ghost).
  4. You can do this via command line too.
    1. cd /etc/nginx/sites-available/
    2. nano blog.example.com
    3. Delete the PHP related items and make the changes based on the Ghost Documentation for Nginx for Ghost.
    4. Then you have to edit the config.production.json file and add the Mailgun email settings for transactional emails, this is different from the newsletter email settings, which will you add via the graphical user interface in Ghost
      1. cd ~/blog.example.com
      2. nano config.production.json
      3. Using the documentation add the credentials for the transactional emails, this allows users to sign-up to your newsletters or blog.

Step 5: Finalizing and Launching Your Ghost Blog

Once the Nginx configuration is updated:

  1. Restart Nginx to apply the new settings.
  2. Ensure that Ghost is running smoothly by accessing your blog at https://blog.domain.com/ghost.

Conclusion:

You’ve now successfully set up a Ghost.org blog on a Laravel Forge hosted service, complete with SSL and the necessary server configurations. This setup provides a robust and secure platform for your blogging needs, leveraging the power of Laravel Forge's simplicity and Ghost's user-friendly blogging interface.

If you encounter any issues or have questions, feel free to reach out in the comments. Happy blogging on your new Ghost-powered site!