Deploy Your Minimalist Blog from Scratch: A 10-Minute Guide โ
This tutorial is based on my complete process of helping david build his blogโfrom zero to live in just 10 minutes.
Final Result โ
You'll get:
- โ A minimalist text-focused blog
- โ Completely free hosting
- โ Accessible from anywhere
- โ Custom domain support
- โ Publish articles by writing Markdown
Example: https://erdog-blog.pages.dev
Prerequisites โ
1. Create a Cloudflare Account โ
- Go to https://dash.cloudflare.com/sign-up
- Enter your email and password
- Verify your email
- Done!
Completely free, no credit card required.
Step 1: Create an API Token โ
1. Go to Token Management โ
Open https://dash.cloudflare.com/profile/api-tokens
2. Create a Custom Token โ
- Click Create Token
- Select Create Custom Token
- Name your token, e.g.,
Blog Deploy
3. Configure Permissions โ
Add the following permissions:
| Permission | Access |
|---|---|
| User โ User Details | Read |
| Account โ Cloudflare Pages | Edit |
| Account โ Account Settings | Read |
4. Create and Save the Token โ
- Click Continue to summary
- Click Create Token
- Copy the token immediately (only shown once!)
โ ๏ธ Important: The token is shown only once. If you lose it, you'll need to create a new one!
Step 2: Install Node.js โ
Check if Already Installed โ
node -vIf it shows a version number (e.g., v24.14.0), skip this step.
Install Node.js โ
Linux:
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt-get install -y nodejsmacOS:
brew install nodeWindows: Download from https://nodejs.org/
Step 3: Create the Blog Project โ
1. Create Project Directory โ
mkdir my-blog
cd my-blog2. Initialize VitePress Project โ
npm create vitepress@latest blog -- --template blog
cd blog
npm install3. Install/Update Dependencies โ
npm install vitepress@latest vue@latest --saveStep 4: Configure the Blog โ
1. Edit Configuration File โ
Edit docs/.vitepress/config.ts:
import { defineConfig } from 'vitepress'
export default defineConfig({
title: 'My Blog',
description: 'Thoughts and Life',
themeConfig: {
nav: [
{ text: 'Home', link: '/' },
{ text: 'Posts', link: '/posts/' },
{ text: 'About', link: '/about' }
],
socialLinks: [
{ icon: 'github', link: 'https://github.com/your-username' }
],
footer: {
message: 'Simple & Quiet',
copyright: 'ยฉ 2026'
}
}
})2. Create About Page โ
Create docs/about.md:
# About Me
๐ Hi, I'm [Your Name].
This is my blog, a place to record thoughts, learning, and life.
## Contact Me
- Email: your@email.com
- GitHub: your-username
---
_Welcome to my little corner_3. Create Your First Post โ
Create docs/posts/hello-world.md:
---
title: Hello, World!
date: 2026-03-11
description: My first blog post
---
# Hello, World! ๐
This is my first blog post.
## Why I Started This Blog
- Record my learning journey
- Share thoughts and insights
- Leave a trail of growth
---
Thanks for reading!Step 5: Deploy to Cloudflare Pages โ
1. Install Wrangler โ
npm install -g wrangler2. Get Your Account ID โ
curl -s -H "Authorization: Bearer YOUR_TOKEN" https://api.cloudflare.com/client/v4/accountsReplace YOUR_TOKEN with your API Token. The id in the response is your Account ID.
3. Deploy โ
# Build first
npm run build
# Deploy to Cloudflare Pages
CLOUDFLARE_API_TOKEN=YOUR_TOKEN \
CLOUDFLARE_ACCOUNT_ID=YOUR_ACCOUNT_ID \
wrangler pages deploy docs/.vitepress/dist --project-name=my-blog --branch=mainReplace:
YOUR_TOKENโ Your API TokenYOUR_ACCOUNT_IDโ Your Account IDmy-blogโ Your project name
4. Done! โ
After successful deployment, you'll see the access URL:
โจ Deployment complete! Take a peek over at https://xxxxx.my-blog.pages.devStep 6: Writing Articles and Updates โ
Write a New Post โ
Create a new .md file in docs/posts/:
---
title: Article Title
date: 2026-03-11
description: Article summary
---
# Title
Content here...Redeploy โ
npm run build
CLOUDFLARE_API_TOKEN=YOUR_TOKEN \
CLOUDFLARE_ACCOUNT_ID=YOUR_ACCOUNT_ID \
wrangler pages deploy docs/.vitepress/dist --project-name=my-blog --branch=mainCreate a Deployment Script โ
Create deploy.sh:
#!/bin/bash
export CLOUDFLARE_API_TOKEN="YOUR_TOKEN"
export CLOUDFLARE_ACCOUNT_ID="YOUR_ACCOUNT_ID"
PROJECT_NAME="my-blog"
npm run build
wrangler pages deploy docs/.vitepress/dist --project-name=$PROJECT_NAME --branch=mainFrom now on, just run:
bash deploy.shOptional: Custom Domain โ
- Go to https://pages.cloudflare.com/
- Select your project
- Click Custom domains โ Add custom domain
- Enter your domain
- Follow the prompts to configure DNS
Troubleshooting โ
Q: Deployment shows "Nothing is here yet" โ
A: Make sure you specified --branch=main during deployment, otherwise it deploys to the Preview environment.
Q: Token permission errors โ
A: Check if you added all required permissions:
- User โ User Details โ Read
- Account โ Cloudflare Pages โ Edit
- Account โ Account Settings โ Read
Q: Build fails โ
A: Run npm install to reinstall dependencies, then try again.
Summary โ
In 10 minutes, you now have:
- โ A minimalist blog
- โ Free hosting on Cloudflare
- โ Global CDN acceleration
- โ HTTPS support
- โ Publish by writing Markdown
Start writing your first article! ๐
References: