How to Automatically Share Your Ghost Blog Posts on LinkedIn, Twitter, and Facebook with N8N
Ever published a blog post and then had to manually copy-paste it to LinkedIn, Twitter, and Facebook? It's tedious and time-consuming. In this guide, I'll show you how I set up automatic posting so that every time I publish a blog post on Ghost, it instantly shares to all my social media accounts. No manual work required!
What You'll Learn:
How to connect Ghost to N8N (an automation tool)
How to automatically post to LinkedIn when you publish a blog
How to format posts differently for each platform
How to include images in your social media posts
What You'll Need:
A Ghost blog (self hosted on your server, preferably)
N8N installed (self-hosted or cloud)
Social media accounts (LinkedIn, Twitter, Facebook)
Time Required: About 1-2 hours for initial setup
What is N8N?
N8N is like a digital assembly line for your data. Think of it as connecting building blocks together:
Block 1: Ghost publishes a post
Block 2: Format the post for social media
Block 3: Post to LinkedIn
Block 4: Post to Twitter
Block 5: Post to Facebook
Each "block" is called a node, and connecting them creates a workflow.
Part 1: Setting Up the Foundation
Step 1: Create Your First Workflow in N8N
Open N8N in your browser
Click the "+" button or "Add Workflow"
Name it something like "Ghost to Social Media"
You'll see a blank canvas - this is where we build!
Step 2: Add the Ghost Webhook (The Starting Point)
A webhook is like a doorbell. When someone (Ghost) rings it, something happens (your workflow runs).
How to Set It Up:
In your blank N8N workflow, click the "+" button
Search for "Webhook"
Click on it to add it to your canvas
Configure these settings:
HTTP Method: POST (this is how Ghost sends data)
Path: Leave it as the auto-generated code (looks like
abc123def456)Authentication: None
Respond: "When Last Node Finishes"
Activate your workflow (toggle switch at top right - make it green!)
Click on the webhook node
Click the "Production URL" tab
Copy this URL - you'll need it in the next step
Important: The Production URL (without -test) only works when your workflow is activated (green toggle).
Step 3: Connect Ghost to Your Webhook
Now we tell Ghost to "ring the doorbell" when you publish a post.
In Ghost Admin:
Go to Settings → Integrations
Click "Add custom integration"
Name it "N8N Blog Automation" (or whatever you like)
Ghost will create API keys - you'll need these later
Scroll down to Webhooks section
Click "Add webhook"
Configure:
Name: "Post Published"
Event: Post published (very important!)
Target URL: Paste your N8N Production URL
Click "Create webhook"
Test It: Publish a test post in Ghost. Go back to N8N and click the "Executions" tab. You should see a new execution appear! If not, check that your workflow is activated.
Part 2: Formatting Your Posts for Social Media
Different platforms have different vibes:
LinkedIn: Professional, longer posts
Twitter: Short and sweet (280 characters)
Facebook: Casual and engaging
Let's create custom text for each platform.
Step 4: Add a Code Node to Format Posts
In N8N, click the "+" after your Webhook node
Search for "Code"
Add it and name it "Format Social Posts"
Paste this code:
Replace yourdomain.com with your actual Ghost domain!
What This Code Does:
Takes your blog post data from Ghost
Creates three different versions of the post
Adds emojis and hashtags
Makes sure URLs work properly
Part 3: Setting Up LinkedIn Posting
Step 5: Create a LinkedIn App
Before N8N can post to LinkedIn, you need to give it permission. This requires creating a "LinkedIn App."
In LinkedIn:
Go to https://www.linkedin.com/developers/apps
Click "Create app"
Fill in:
App name: "Blog Automation" (or similar)
LinkedIn Page: Select your personal profile or company page
App logo: Upload any image
Check the legal agreement box
Click "Create app"
After creation, go to "Products" tab
Request access to:
"Share on LinkedIn"
"Sign In with LinkedIn using OpenID Connect"
These are usually approved instantly
Go to "Auth" tab
Under "OAuth 2.0 settings", find "Redirect URLs"
Add:
https://your-n8n-domain.com/rest/oauth2-credential/callbackReplace with your actual N8N URL
Copy your Client ID and Client Secret - you'll need these
Important Note: To post to a company page (not your personal profile), you need additional approval from LinkedIn for "Community Management API." This can take days. For now, posting to your personal profile works immediately and still promotes your business!
Step 6: Add LinkedIn Node in N8N
In N8N, click "+" after your "Format Social Posts" node
Search for "LinkedIn"
Add it
Click "Create New Credential"
Enter:
Client ID: From LinkedIn app
Client Secret: From LinkedIn app
Click "Connect" or "Sign in with LinkedIn"
A popup opens - log into LinkedIn and authorize
The popup closes and you're connected!
Configure the LinkedIn Node:
Resource: Post
Operation: Create
Post As: Person (use "Organization" only if you have Community Management API approved)
Text:
{{ $json.linkedin_text }}Visibility: Public
Step 7: Add Images to LinkedIn Posts
To include your blog's featured image:
Add HTTP Request node between "Format Social Posts" and "LinkedIn"
Configure HTTP Request:
Method: GET
URL:
{{ $json.featured_image }}Options → Add "Response Format" → Select "File"
Options → Add "Put Output in Field" → Type "data"
In LinkedIn node, scroll to Additional Fields
Click "Add Field" → Select "Media Category" → Choose "Image"
Input Binary Field: Leave as "data"
Your workflow now looks like:
The HTTP Request downloads the image, and LinkedIn posts it!
Part 4: Adding Twitter and Facebook (Optional)
The process is similar for Twitter and Facebook. Here's the overview:
For Twitter:
Go to https://developer.twitter.com/en/portal/dashboard
Create an app and get API credentials
In N8N, add a Twitter node
Connect with your credentials
Configure:
Operation: Create a Tweet
Text:
{{ $json.twitter_text }}
For Facebook:
Go to https://developers.facebook.com/apps
Create an app and get credentials
In N8N, add a Facebook Graph API node
Connect and authorize
Configure:
Resource: Post
Operation: Create
Message:
{{ $json.facebook_text }}
Pro Tip: Connect all social media nodes in parallel from "Format Social Posts" so they all post at the same time!
Part 5: Testing Your Automation
Final Workflow Structure
How to Test:
Make sure your workflow is Activated (green toggle!)
Go to Ghost and publish a test blog post
In N8N, click the "Executions" tab
You should see a new execution with all green checkmarks
Check your social media - your posts should be live!
Troubleshooting Common Issues
"Nothing here yet" in Executions
Problem: Webhook isn't triggering
Solution:
Check that workflow is activated (green toggle)
Verify Ghost has the correct Production URL (not Test URL)
Make sure you're using the webhook for "Post published" event
"Duplicate post detected" on LinkedIn
Problem: You already posted this exact content
Solution: LinkedIn blocks identical posts. Publish a NEW blog post or edit the title/content slightly
"Invalid URL" error
Problem: URLs are malformed
Solution: Check the "Format Social Posts" code and make sure you replaced
yourdomain.comwith your actual domain
LinkedIn won't connect
Problem: OAuth scope errors
Solution:
Make sure "Share on LinkedIn" product is approved in your LinkedIn app
For personal posting, use "Post As: Person"
For company page posting, you need "Community Management API" (requires approval)
Image won't upload
Problem: LinkedIn expects binary data
Solution: Make sure you added the HTTP Request node to download the image BEFORE the LinkedIn node
Advanced Tips
Customize Post Text by Platform
Edit the "Format Social Posts" code to add:
Hashtags specific to each platform
Emojis that match your brand
@mentions of your company account
Call-to-actions tailored to each audience
Add Conditional Logic
Want to only post certain types of content? Add an IF node:
Check if post has a specific tag (like "public" or "share")
Only continue to social media if tag exists
Otherwise, skip posting
Add Error Notifications
Add an Email node or Slack node that only runs if LinkedIn/Twitter/Facebook fail. This way you'll know immediately if something breaks.
Schedule Posts Instead
Instead of instant posting:
Add a Wait node to delay by a few hours
Or use a Schedule Trigger to post at optimal times
Combine with a database to queue posts
What I Learned
Setting up automation takes time upfront, but saves hours every week. Here are my key takeaways:
Start simple: Get one platform working (like LinkedIn) before adding others
Test extensively: Publish multiple test posts to catch edge cases
Read error messages carefully: They usually tell you exactly what's wrong
LinkedIn's API has restrictions: Posting to company pages requires special approval, but personal posts work great and still promote your business
Images need special handling: URLs aren't enough - you need to download the image as binary data first
Conclusion
Congratulations! You now have a fully automated blog-to-social-media pipeline. Every time you hit "Publish" in Ghost, your content automatically shares across your social networks with platform-specific formatting and images.
Time saved per post: 10-15 minutes Posts per month: ~4-8 Annual time savings: 8-24 hours
That's a full workday (or more!) back in your schedule!
Next Steps
Now that you have the basics working, consider:
Adding Instagram posting (requires Facebook Business account)
Creating platform-specific image templates
Setting up analytics tracking
Building a dashboard to monitor post performance
Adding AI-generated social media captions
Happy automating!
Resources
N8N Documentation: https://docs.n8n.io
Ghost API Docs: https://ghost.org/docs/content-api/
LinkedIn Developer Portal: https://www.linkedin.com/developers/
Twitter API Docs: https://developer.twitter.com/en/docs
Facebook Graph API: https://developers.facebook.com/docs/graph-api
Note: API requirements and interfaces change over time. If something doesn't match this guide exactly, check the official documentation for the most current information.


