Lädt...


🔧 Goodbye Ghost.org: How to Move Your Blog to Your Own Server


Nachrichtenbereich: 🔧 Programmierung
🔗 Quelle: dev.to

If you host your blog on The Ghost Cloud, you might think it's too expensive. For example, from 2024 you will only be able to access the API if you pay $25 a month, which comes to $300 a year. In my opinion, that is a lot of money.

And if you don't need all the fancy plugins and some of the fancy themes they offer, you might think twice about whether it's worth paying that price every year. Instead, you could simply move your blog to another provider, or even better, host it yourself.

In this blog post, we're going to do just that. We'll migrate your Ghost instance from Ghost.org to your own instance for just $5 per month. This will save you tons of money and give you unlimited access to the API, all themes and plugins.

We'll walk you through the entire process step-by-step, including setting up a new server, exporting your data, configuring your domain, importing your data, and making sure your images are migrated properly.

In the end, your blog will be up and running on your own server, giving you more control and flexibility.

Let's go.

Step 1: Install Ghost on DigitalOcean

In DigitalOcean, you can simply use a ready-to-use appliance that has everything already configured. Here's how:

First, sign up for DigitalOcean if you haven't already. Then, go to the dashboard here and create a new droplet.

Select a droplet from the marketplace with Ghost as shown below.

Choose any plan you like. For a start, the basic plan suffices.

After a few minutes, your instance should be up and running. Note the IP address and the SSH key or password you selected during the creation.

Step 2: Exporting Your Data

Now, go to your Ghost Cloud settings at https:///ghost/#/settings and export your data.

Assume you've saved the export as export.json (renaming it for simplicity).

Next, copy this file to your DigitalOcean instance using the following command:

scp -i ~/.ssh/do ~/export.json [email protected]:/tmp/export.json

Step 3: Configure the Domain

A good blog probably needs a good domain. If you already have a domain, you can use it. Make sure you have access to the domain configuration to set up the DNS if necessary.

If not, you can use any domain provider such as Namecheap (my favourite) or GoDaddy (too complicated in my opinion).

If you don't have a domain yet, you can test your blog with the IP of your DigitalOcean instance without any problems and add the domain later.

Step 4: Finish the Setup

With the export file and the domain at hand, we can now finish the setup and import the data. Log in to the instance using SSH:

ssh root@your_server_ip

Ghost will prompt you for two details related to your domain. If you don't have a domain, you can simply use the IP of the DigitalOcean instance as shown below.

  1. Your domain\
    1. Add an A Record -> xxx.xxx.xxx.xxx & ensure the DNS has fully propagated\
    2. Or alternatively enter http://xxx.xxx.xxx.xxx\
  2. Your email address (only used for SSL)\ Press enter when you're ready to get started!

Now you should be able to see the instance at http:///ghost/. The posts are still empty or have only one dummy post. You can configure the themes and other settings anytime later.

Step 5: Import the Data

Now, let's import the data we exported from Ghost.org. Select the .json file from the export (export.json).

The import should finish, and you should already be able to see the posts.

http://

That's great, but if you have images saved in Ghost Cloud, you probably won't be able to see them yet.

The reason is that the export file includes only the links to the image files saved on Ghost Cloud. I don't know why Ghost.org does that, although many people complain about it. I presume it's to increase the migration effort?

In any case, we need to solve it.

The Simple Solution

The solution is to download the images and save them in the images folder under /var/www/ghost/content/images.

Assuming the export file is in /tmp/export.json, here's a one-liner that will do just that. Make sure to replace airabbit.blog with the URL of your website accordingly.

grep -oE '__GHOST_URL__/content/images[^" ]+\.(png|jpe?g|gif|bmp|svg)' /tmp/export.json \\
| sed 's|__GHOST_URL__|https://airabbit.blog|' \\
| while read -r url; do \\
    relative_path="${url#https://airabbit.blog/content/images/}" \\
    mkdir -p "/var/www/ghost/content/images/$(dirname "$relative_path")" && \\
    wget -nc "$url" -O "/var/www/ghost/content/images/$relative_path"; \\
done | tee download.log

Done.

Let's Test It

Now visit your instance. Here is my instance after importing all the images:

Great, it looks much more interesting with the images now!

Finally, let's see if we can access the API. Here's a simple curl command that can fetch all your posts. Make sure to set the key and the urlaccordingly.

curl --location --request GET 'http://143.xxxx/ghost/api/content/posts/?key=xxxx&fields=title,url&limit=200' \\
--header 'Accept-Version: v5.0'

And here is the result:

Wrap Up

In this blog post, we covered the nuts and bolts of migrating a blog from Ghost.org, complete with posts and images.\
First, we spun up an instance at DigitalOcean using an out-of-the-box appliance. We added the domain, imported the exported data and finally imported the images.\
That was the hard part of the migration and our blog was up and running.\
What remains is to migrate the users and set up an email provider.\
For more information, you can refer to the Ghost documentation.

Happy blogging!

...

🔧 Goodbye Ghost.org: How to Move Your Blog to Your Own Server


📈 64.16 Punkte
🔧 Programmierung

📰 CentOS Seven blog: Seven.centos.org is dead .. long life to blog.centos.org !


📈 34.33 Punkte
🐧 Unix Server

🔧 Goodbye Netlify, Hello Ghost: My Blog's New Home


📈 31.21 Punkte
🔧 Programmierung

🔧 Build Your Own Ghost Blog from Scratch: A Step-by-Step Guide


📈 27.72 Punkte
🔧 Programmierung

🔧 Goodbye my friend, goodbye Ruby , Hello Javascript 👋🙁.


📈 26.31 Punkte
🔧 Programmierung

🔧 [Blog Template] Create your own blog site with this Ready-to-use Template, built with Next.js


📈 26.28 Punkte
🔧 Programmierung

🔧 Pong in my own language in my own graphics library in my own game


📈 23.5 Punkte
🔧 Programmierung

🐧 Huawei releases it's own desktop PC with their own OS based on Linux and their own ARM CPU.


📈 23.5 Punkte
🐧 Linux Tipps

🔧 Self hosting ghost blog on your home server


📈 22.77 Punkte
🔧 Programmierung

🐧 The end of an era: Saying goodbye to search.cpan.org


📈 22.01 Punkte
🐧 Linux Tipps

🐧 Goodbye, EdgeHTML – The Mozilla Blog


📈 21.46 Punkte
🐧 Linux Tipps

🔧 Ditch the Server, Own Your Words: Building a Decentralized Blog with IPFS


📈 20.85 Punkte
🔧 Programmierung

🐧 X.Org security advisory: Privilege escalation and file overwrite in X.Org X server 1.19 and later


📈 20.59 Punkte
🐧 Linux Tipps

🐧 X.Org Security Advisory: Issues in X.Org X server prior to 21.1.12 and Xwayland prior to 23.2.5


📈 20.59 Punkte
🐧 Linux Tipps

🕵️ X.org X.Org Server up to 1.14.3 Service dix/dixfonts.c doImageText resource management


📈 20.59 Punkte
🕵️ Sicherheitslücken

🎥 MCS2023 — Making Your Org Move Communications from Discord to Matrix


📈 20.4 Punkte
🎥 Video | Youtube

🔧 Deploy Your Ghost Blog in Minutes with KVMPods


📈 19.89 Punkte
🔧 Programmierung

📰 Ghost Recon Breakpoint: Startzeit, Day-1-Patch, Zusatzinhalte, Skell-Credits und kaufbare Ghost Coins


📈 19.5 Punkte
📰 IT Nachrichten

🕵️ Low CVE-2016-10983: Ghost Ghost


📈 19.5 Punkte
🕵️ Sicherheitslücken

📰 Ghost Recon Breakpoint: Videos zu Aurora und Ghost War – Beta-Statistiken enthüllt


📈 19.5 Punkte
📰 IT Nachrichten

📰 "Ghost Recon Breakpoint": Neuer PvP-Modus Ghost War enthüllt


📈 19.5 Punkte
📰 IT Nachrichten

📰 Ghost Recon: Breakpoint: gamescom-Vorschau zum PvP-Modus Ghost War


📈 19.5 Punkte
📰 IT Nachrichten

📰 Ghost Recon Breakpoint - Ubisoft zeigt den PvP-Modus 'Ghost War'


📈 19.5 Punkte
📰 IT Security Nachrichten

📰 Ghost Recon: Breakpoint bekommt verbesserten PvP-Modus Ghost War


📈 19.5 Punkte
📰 IT Nachrichten

📰 Ghost Recon: Breakpoint - Was ändert sich im Multiplayer von Ghost War 2.0?


📈 19.5 Punkte
📰 IT Nachrichten

🪟 Ghost Recon Breakpoint 'Ghost War' multiplayer focuses on tactical combat


📈 19.5 Punkte
🪟 Windows Tipps

📰 Ghost of Tsushima 2: Release und Inhalt von Ghost of Yotei


📈 19.5 Punkte
🖥️ Betriebssysteme

🪟 Ghost Recon Wildlands gets Ghost Recon Future Soldier content today


📈 19.5 Punkte
🪟 Windows Tipps

📰 "Ghost of Yotei": Sucker Punch setzt "Ghost of Tushima" fort


📈 19.5 Punkte
📰 IT Nachrichten

📰 Tom Clancy's Ghost Recon Wildlands: ​Ghost War - PvP-Modus angespielt


📈 19.5 Punkte
📰 IT Nachrichten

📰 Ghost Recon Wildlands: Modus 'Ghost War' enthüllt, Details zur Beta


📈 19.5 Punkte
📰 IT Security Nachrichten

🕵️ Ghost up to 4.3.2 Endpoint /ghost/preview cross site scripting


📈 19.5 Punkte
🕵️ Sicherheitslücken

📰 Ghost Recon Breakpoint: Ghost-Erlebnis-Update-Trailer


📈 19.5 Punkte
📰 IT Nachrichten

📰 Ghost Recon Breakpoint - Update 2.0 im März: Ghost-Erfahrung, zweite Episode und viele Verbesserungen


📈 19.5 Punkte
📰 IT Nachrichten

matomo