Exclusive Metin2 game shield on FreeBSD: Automatic siege mode, VIP list, and whitelist from your dashboard. See how it works
Create a server

Guide

How to Set Up a Static Site with Hexo

Hexo is a popular Node-based static blog generator. On a VPS you build public/ and serve it without Node in production.

Steps

  1. Install Node.js LTS and the Hexo CLI:

    node -v || (curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - && sudo apt install -y nodejs)
    sudo npm install -g hexo-cli
    hexo version
  2. Initialize the blog and install dependencies:

    cd ~ && hexo init hexo-demo && cd hexo-demo
    npm install
  3. Generate the public/ folder:

    hexo generate
    ls public
  4. Serve public/ with Nginx:

    sudo mkdir -p /var/www/hexo-demo
    sudo rsync -a ~/hexo-demo/public/ /var/www/hexo-demo/
    sudo tee /etc/nginx/sites-available/hexo-demo >/dev/null <<'EOF'server {  listen 80;  server_name example.com;  root /var/www/hexo-demo;  index index.html;}EOF
    sudo ln -sf /etc/nginx/sites-available/hexo-demo /etc/nginx/sites-enabled/hexo-demo
    sudo nginx -t && sudo systemctl reload nginx

Tips

  • After new posts: hexo generate then rsync public/ again.
  • Do not expose hexo server to the internet — only the static build.

ext step

Run Hexo on your own VPS: Deploy your Cloud VPS.

Related guides