Ghost is an open-source platform for professional content creators. It’s widely used for blogging, newsletters, and websites that prioritize simplicity and performance. Ghost is built on Node.js and offers features such as:
- Modern Editing: Markdown-based editor for creating visually rich content.
- Built-in SEO and Social Tools: Simplifies optimization for search engines and social media.
- Custom Themes: Flexibility to create unique designs with handlebars templates or buy premium themes.
- APIs for Custom Integration: Ghost provides robust APIs for integrating with other tools.
- Self-hosting or Managed Hosting: You can host Ghost on your own server or use Ghost Pro (managed hosting).
Steps to Create and Deploy a Custom Ghost Website to Akash
1. Set Up Ghost Locally
Install Ghost CLI
Ghost CLI is a command-line tool for installing and managing Ghost.
npm install -g ghost-cli
Create a New Ghost Instance
- Create a directory for your project and navigate to it:
Terminal window mkdir my-ghost-site && cd my-ghost-site - Install Ghost:
Terminal window ghost install local - Access the local site in your browser at
http://localhost:2368
.
Customize Your Ghost Website
-
Choose or Create a Theme:
- Download a theme from Ghost Marketplace.
- Or, create a custom theme following the Ghost Theme Documentation.
Place the theme in the
content/themes
directory. -
Activate the Theme:
- Access the admin panel at
http://localhost:2368/ghost
. - Upload and activate your theme under “Settings > Design.”
- Access the admin panel at
-
Add content, configure SEO settings, and preview your website.
2. Prepare Ghost for Deployment
-
Export Data (Optional): If you already have content, export it from the admin panel (
Settings > Labs > Export
). -
Set Up Production Configuration: Update the
config.production.json
file with your production settings:{"url": "https://your-domain.com","server": {"port": 2368,"host": "0.0.0.0"},"database": {"client": "sqlite3","connection": {"filename": "/path/to/ghost/content/data/ghost.db"}},"mail": {"transport": "Direct"},"logging": {"level": "info"},"process": "systemd"}
3. Package Ghost for Akash
Create a Dockerfile
Build a Docker image to containerize Ghost for Akash.
FROM ghost:latest
# Set the working directoryWORKDIR /var/lib/ghost
# Copy custom contentCOPY ./content /var/lib/ghost/content
# Expose the Ghost portEXPOSE 2368
# Start GhostCMD ["npm", "start"]
Build and Push the Docker Image
- Build the Docker image:
Terminal window docker build -t your-dockerhub-username/ghost-custom . - Push the image to Docker Hub:
Terminal window docker push your-dockerhub-username/ghost-custom
4. Deploy Ghost on Akash
Install Akash CLI
Follow the installation instructions from the Akash CLI Guide.
Create an SDL File
Define the deployment parameters in an SDL file (deploy.yaml
):
version: "2.0"
services: ghost: image: your-dockerhub-username/ghost-custom:latest expose: - port: 2368 as: 80 to: - global: true
profiles: compute: ghost: resources: cpu: units: 1 memory: size: 512Mi storage: size: 1Gi
placement: default: attributes: region: us-west signedBy: anyOf: - "akash1abcd...xyz" pricing: ghost: denom: uakt amount: 100
deployment: ghost: profiles: - compute: ghost placement: default count: 1
Deploy to Akash
- Deploy the application:
Terminal window provider-services tx deployment create deploy.yaml --from your-wallet - Check the status of your deployment:
Terminal window provider-services query deployment list --owner your-wallet-address
Point a Domain to Your Akash Deployment
- Get the public IP of your deployment.
- Configure your DNS settings to point your domain to this IP.
5. Verify and Maintain
- Access your website using your domain.
- Monitor logs to ensure smooth operation:
Terminal window docker logs -f <container_id> - Update Ghost or your custom theme when needed.
This guide gives you a flexible and cost-effective way to host your Ghost website on the Akash decentralized cloud.