A big thank you to all who shared their theme development setup, here’s what I got which is working really well on Widows 10, with the help of Linux/Ubuntu. This is for when you are self-hosting Ghost and have Shell/SSH access and have a Ghost site up and running on your VPS.
- VS Code Download Visual Studio Code - Mac, Linux, Windows
- Github Desktop https://desktop.github.com/
- WSL2 - Windows Linux Subsystem Install WSL | Microsoft Learn
- Github w Ghost Deploy Action Deploy Ghost Theme · Actions · GitHub Marketplace · GitHub
Install Ubuntu on Windows 10
One-command install of Ubuntu on Windows 10. Amazing stuff. Then install NodeJS (18.x.x) & Ghost-CLI & Ghost in Ubuntu. Create a subdirectory in /home for your local dev, ex localghost, and run ghost install local
in this directory ie /home/user/localghost
Important: Go to your fresh local ghost install at localhost:2368 and create an admin user.
Done! Now stop ghost with ghost stop
Pull your existing Site content to local
Create a zip/tar archive of the full Ghost directory on your production Ghost on the VPS.
Download to your windows machine and extract to c:\code\ghost
or similar
Also export your site contents from Ghost Admin - Labs - Export
Replace the /content in “Ghost on Ubuntu” with Win10 /content
Remove the Ubuntu-ghost /content directory rm -rf /home/user/localghost/content
All windows drives are mounted under /mnt so link the windows dir
ln -s /mnt/c/code/ghost/content /home/[ubunutuser]/localghost/content
Start ghost with ghost start
Ubuntu Ghost now reads content from Windows c:\code\ghost\content
folder - wahoo.
Import your Production content json file in Ghost Admin - Labs - Import on local dev ghost
Put the theme under Git version control
Install Git Desktop for Windows (truly a gift to mankind…) and create a repository in existing folder c:\code\ghost\content\themes\mytheme
and create & push this new repository to GitHub.
Create a Github Action to deploy the theme on Push
Get the admin API key from your production Ghost install and follow instructions at
Edit theme in VS Code
Open the c:\code\ghost\content\themes\mytheme
in VS Code, add Handlebars and Ghost (!) helpers.
Edit theme files
Push changed files
Create a Commit in Git Desktop and push to GitHub. This triggers the Action and deploys your theme to production. 60 seconds later the theme is live on you production Ghost. So smooth it’s unreal.
Have fun!