Skip to content

Deploy to Other Hosts

Netlify is the recommended host for ForgeDocs because it includes Identity and Git Gateway for Decap CMS. But you can deploy ForgeDocs to any static host.

This guide covers deployment to:

  • Vercel
  • Cloudflare Pages
  • Firebase Hosting
  • AWS S3 + CloudFront
  • cPanel
  • VPS (Ubuntu + Nginx)

Each section includes build settings and deployment steps.

Important: Decap CMS requires a Git-based backend with authentication. Netlify Identity + Git Gateway is the easiest setup. Other hosts can use Decap CMS with GitHub OAuth or another backend — but the setup is more involved. If you’re using Decap CMS, Netlify is recommended.

If you’re using Code Only, any static host works.

All static hosts use the same build settings:

Setting Value
Build command npm run build
Output directory dist
Node version 18 or 20
Install command npm install

Vercel is a popular static host with a generous free tier.

  1. Go to vercel.com/new
  2. Sign in with GitHub
  3. Click Import next to your forgedocs repository
  4. Vercel auto-detects Astro. Verify:
    • Framework Preset: Astro
    • Build Command: npm run build
    • Output Directory: dist
  5. Click Deploy

Your site is live at https://your-project.vercel.app.

  1. Go to your project → Settings → Domains
  2. Enter your domain
  3. Follow Vercel’s DNS instructions

Vercel does not include Identity or Git Gateway. To use Decap CMS:

  • Use GitHub OAuth instead of Git Gateway
  • Configure the OAuth app in GitHub settings
  • Add backend: name: github in config.yml

The setup is documented in Decap CMS docs.

Cloudflare Pages is fast and free, with unlimited bandwidth.

  1. Go to dash.cloudflare.com
  2. Sign in or create an account
  3. Click Workers & Pages → Create application → Pages → Connect to Git
  4. Authorize Cloudflare to access GitHub
  5. Select your forgedocs repository
  6. Configure build settings:
    • Framework preset: Astro
    • Build command: npm run build
    • Build output directory: dist
  7. Click Save and Deploy

Your site is live at https://your-project.pages.dev.

  1. Go to your Pages project → Custom domains
  2. Click Set up a custom domain
  3. Enter your domain
  4. Follow Cloudflare’s DNS instructions

Cloudflare does not include Identity or Git Gateway. Use GitHub OAuth instead — same setup as Vercel.

Firebase Hosting is Google’s static hosting service.

  • Node.js installed
  • A Google account
  • Firebase CLI installed:
Terminal window
npm install -g firebase-tools
  1. Log in to Firebase:
Terminal window
firebase login
  1. Initialize Firebase in your project:
Terminal window
firebase init hosting

When prompted:

  • Project: create a new project or select an existing one
  • Public directory: dist
  • Single-page app: No
  • Set up automatic builds with GitHub: optional
  • Overwrite dist/index.html: No
  1. Build your site:
Terminal window
npm run build
  1. Deploy:
Terminal window
firebase deploy

Your site is live at https://your-project.web.app.

  1. Go to Firebase Console
  2. Select your project
  3. Go to Hosting → Add custom domain
  4. Follow Firebase’s DNS instructions

Firebase does not include Identity or Git Gateway. Use GitHub OAuth instead.

AWS S3 is a low-cost static host. CloudFront adds CDN and HTTPS.

  • An AWS account
  • AWS CLI installed and configured
  1. Build your site:
Terminal window
npm run build
  1. Create an S3 bucket:
Terminal window
aws s3 mb s3://your-bucket-name
  1. Enable static website hosting:
Terminal window
aws s3 website s3://your-bucket-name --index-document index.html --error-document 404.html
  1. Upload files:
Terminal window
aws s3 sync dist/ s3://your-bucket-name --delete
  1. Make files public:
Terminal window
aws s3api put-bucket-policy --bucket your-bucket-name --policy file://policy.json

Create policy.json:

{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::your-bucket-name/*"
}
]
}
  1. Access your site at:
http://your-bucket-name.s3-website-your-region.amazonaws.com

For HTTPS and global CDN:

  1. Go to AWS Console → CloudFront → Create distribution
  2. Origin domain: select your S3 bucket
  3. Viewer protocol policy: Redirect HTTP to HTTPS
  4. Default root object: index.html
  5. Click Create distribution

AWS does not include Identity or Git Gateway. Use GitHub OAuth instead.

cPanel is a control panel used by many shared hosts. It works if your host allows Node.js builds or if you upload the built files.

  1. Build your site locally:
Terminal window
npm run build
  1. Zip the contents of dist/:
Terminal window
cd dist
tar -czf ../forgedocs-build.tar.gz .
  1. Log in to cPanel
  2. Open File Manager
  3. Navigate to public_html/
  4. Upload forgedocs-build.tar.gz
  5. Extract it in public_html/

Your site is live at your domain.

Note: You’ll need to rebuild and re-upload every time you change content.

Some cPanel hosts support Node.js apps via Setup Node.js App. If yours does:

  1. Go to Setup Node.js App → Create Application

  2. Node.js version: 18 or 20

  3. Application root: forgedocs

  4. Application URL: your domain

  5. Application startup file: leave blank

  6. Click Create

  7. Upload your project files to forgedocs/

  8. Run:

Terminal window
cd forgedocs
npm install
npm run build
  1. Point the document root to forgedocs/dist/

cPanel does not include Identity or Git Gateway. Use GitHub OAuth instead. This requires a backend server for OAuth — either a separate service or a serverless function.

A VPS gives you full control. This guide uses Ubuntu 22.04 and Nginx.

  • A VPS with Ubuntu 22.04
  • SSH access
  • A domain pointed to your VPS IP
Terminal window
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt install -y nodejs
node --version
Terminal window
sudo apt update
sudo apt install -y nginx
Terminal window
cd /var/www
sudo git clone https://github.com/yourusername/forgedocs.git
cd forgedocs
sudo npm install
sudo npm run build

Create a new config file:

Terminal window
sudo nano /etc/nginx/sites-available/forgedocs

Add:

server {
listen 80;
server_name your-domain.com www.your-domain.com;
root /var/www/forgedocs/dist;
index index.html;
location / {
try_files $uri $uri/ /404.html;
}
location ~* \.(jpg|jpeg|png|gif|ico|css|js|svg|webp|avif)$ {
expires 1y;
add_header Cache-Control "public, immutable";
}
gzip on;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml;
}

Enable the site:

Terminal window
sudo ln -s /etc/nginx/sites-available/forgedocs /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx
Terminal window
sudo apt install -y certbot python3-certbot-nginx
sudo certbot --nginx -d your-domain.com -d www.your-domain.com

Follow the prompts. Certbot auto-renews every 90 days.

Step 6 — Auto-Deploy on Git Push (Optional)

Section titled “Step 6 — Auto-Deploy on Git Push (Optional)”

Create a deploy script:

Terminal window
sudo nano /var/www/forgedocs/deploy.sh

Add:

#!/bin/bash
cd /var/www/forgedocs
git pull
npm install
npm run build

Make it executable:

Terminal window
sudo chmod +x /var/www/forgedocs/deploy.sh

Add a GitHub webhook:

  1. Go to your GitHub repo → Settings → Webhooks
  2. Add webhook: https://your-domain.com/deploy
  3. Set a secret

Then create a small Node.js server to handle the webhook, or use a service like webhook.site.

VPS does not include Identity or Git Gateway. Use GitHub OAuth with a small backend — or use Decap CMS with a local backend if you only edit from your own machine.

Host Free Decap CMS Best For
Netlify Yes ✅ Easiest Decap CMS users
Vercel Yes ⚠️ GitHub OAuth Next.js/Astro users
Cloudflare Pages Yes ⚠️ GitHub OAuth Speed-focused
Firebase Yes ⚠️ GitHub OAuth Google ecosystem
AWS S3 No ⚠️ Complex Enterprise
cPanel Depends ❌ Shared hosting
VPS No ⚠️ Custom Full control

Recommendation: Use Netlify if you’re using Decap CMS. Use Cloudflare Pages or Vercel if you’re using Code Only and want speed.

Check Node.js version. Set it to 18 or 20 in your host’s settings.

Configure your host to serve 404.html for unknown routes. For Nginx:

error_page 404 /404.html;

Verify site in astro.config.mjs matches your domain. Astro uses this to generate absolute URLs.

Check the build output directory. It should be dist, not public.

Now that you’re deployed, explore the Developer Guide:

→ Project Structure

→ Update JSON Data

→ Update Pages

If you’re stuck: