Learn how to deploy your CampsiteJS site to various hosting platforms, including step-by-step guides for popular services.
Preparing Your Site for Deployment
Deploying your CampsiteJS site is a straightforward process. This guide will walk you through the steps to deploy your static site to popular hosting platforms such as Cloudflare, Netlify, and Vercel.
Before deploying, ensure that your site is built and ready for production. Run the following command in your terminal:
npm run build
This command generates the static files for your site in your outDir (defaults to ./public).
Deployment Paths
From here there are two paths you can take to deploy your site, depending on your preferred hosting platform.
Path 1: Using Traditional Web Hosting
cPanel, Plesk, or Traditional Web Hosting: The simplest way is to upload the contents of your outDir (e.g. ./public) to your web server’s public directory (often public_html or www).
- Run
camper build(ornpm run build). - Connect to your host using file manager or FTP.
- Upload all files from your
outDir(defaultpublic/) to the server’s public folder. - Your site is live!
Cloudflare Pages
- Connect your Git repo in Cloudflare Pages.
- Build command:
npm run build(orcamper build) - Build output directory:
public(or youroutDirfrom config) - Deploy.
Netlify
- New site from Git → connect repo.
- Build command:
npm run build - Publish directory:
public(match youroutDir) - Deploy.
Vercel
- New Project → import Git repo.
- Build command:
npm run build - Output directory:
public(or your configuredoutDir) - Deploy. Vercel often auto-detects.
Conclusion
Deploying your CampsiteJS site is easy with the variety of hosting options available. Choose the platform that best suits your needs and follow the steps outlined above to get your site live in no time!