DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
VGSources
Blog

How to Create a Blog With Hexo on a Linux VPS

A complete deployment guide for building Hexo, publishing the generated public directory to a Linux VPS, serving it with NGINX, and securing the domain with Certbot.
Length11 min Posted Quest giverVGSources Team
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A Hexo blog on a Linux VPS is a static website: you write Markdown and theme files, Hexo turns them into HTML, CSS, JavaScript and assets in a public directory, and NGINX serves those files. The reliable production path is to build the site, publish only public to a versioned directory, point an NGINX server block at it, then use DNS and Certbot to put the domain behind HTTPS.

What you are building

Hexo is a static-site generator rather than a PHP application or database-backed content management system. Your source project contains Markdown posts, configuration, theme files and package metadata. Running Hexo renders that source into deployable files under public. Visitors never need Node.js, npm or the Hexo source repository; they receive the generated files from NGINX.

As an Amazon Associate I earn from qualifying purchases.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The finished request path looks like this:

  • You edit a post in source/_posts.
  • Hexo processes the post, theme and _config.yml.
  • hexo generate writes the complete site to public.
  • You copy that directory to the VPS.
  • NGINX maps the domain and request URI to files in the published directory.
  • DNS sends the domain to the VPS, and Certbot provisions a TLS certificate for HTTPS.

Because the production server only serves static files, it does not need the Hexo source tree or your editing credentials in its web root. Keep those outside the directory NGINX exposes.

Prerequisites and version choices

You can build on your own computer, on the VPS, or in a CI system. Whichever machine runs Hexo needs Git and a supported Node.js release. Hexo’s current compatibility table lists Node.js 20.19.0 as the minimum for Hexo 8.0 and newer. Hexo recommends using the latest Hexo release and its recommended Node.js version whenever possible.

#1 Best Overall
Sale
Gaoye Blue Light Blocking Glasses
  • BLUE LIGHT BLOCKING GLASSES: Our blue light glasses for women boast UV400 protection, blocking harmful blue rays from computer screens. With these bluelight glasses women, you can enjoy gaming, reading, or watching TV with no worries of eye strain.
  • EYE RELIEF: Our blue light glasses are engineered to reduce blurry vision or strain caused by prolonged screen time. These womens blue light glasses aid in better sleep by preventing blue light from disrupting your natural sleep cycle, helping you fall asleep faster and enjoy a more restful night's sleep, making them the perfect christmas present.
  • COMFORTABLE: Crafted from durable material, our trendy blue light glasses for woman or blue light glasses men ensure long-lasting comfort. The high-transmittance lenses accessories, gamer gifts for men, help keep your eyes relaxed. Perfect stocking stuffers, gifts for gamers men, christmas gifts for men, halloween costumes.
  • LIGHTWEIGHT: These clear blue light glasses feature a lightweight frame, meaning they’ll stay comfy for long-term wear. Perfect as blue blockers glasses for women or mens blue light glasses, these non-prescription fake glasses for men can be worn throughout the day. The blue light blocking glasses women feature polycarbonate HD lenses, which are anti-reflective and restore true color.
  • WORRY-FREE PURCHASE: If you experience any issues, our support team is ready to assist you quickly. These are the perfect costume glasses for cosplay dressing up.
Component Requirement or role
Linux VPS A server with SSH access, a public IPv4 address, and, if used, a public IPv6 address. Choose resources according to site size, traffic and build dependencies; the documentation does not establish a universal VPS size.
Node.js Node.js 20.19.0 or newer for Hexo 8.0+. Pin the major version used by your project so local and production builds behave consistently.
Git Required by Hexo’s documented setup and useful for versioning source and releases.
Domain A name for which you can create A and, where applicable, AAAA records.
NGINX The web server that reads files from the generated directory and handles HTTP and HTTPS.
Certbot Used with its NGINX integration to request a certificate and edit the NGINX configuration.

Install Git and Node.js using your Linux distribution’s supported packages or a maintained Node.js version manager. Avoid mixing a system Node.js installation with an unrelated global npm prefix unless you understand which executable and package directory your shell will use.

Install Hexo and create the project

On the machine where you will author and build the site, install the command-line package and create a starter project:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
npm install -g hexo-cli
hexo init blog
cd blog
npm install
hexo new "Hello Hexo"
hexo server

hexo init blog creates the starter project. The project includes _config.yml, package.json, scaffolds, source and themes. The new post is written below source/_posts. By default, hexo server starts a preview server at http://localhost:4000/.

Keep the project in Git from the first change:

git init
git add .
git commit -m "Initialize Hexo site"

Do not commit private deployment keys, server passwords or tokens. Store those in your operating system’s protected credential mechanism or in your deployment system.

Configure the site before publishing

Open _config.yml and set the values that affect generated URLs and presentation. At minimum, review the site title, subtitle, language, URL, permalink policy, theme and any deployment section supplied by the theme or plugin.

title: Your Gaming Blog
subtitle: Notes, guides and news
url: https://example.com
permalink: :year/:month/:day/:title/

Use the final canonical HTTPS hostname in url. If your public site is only on the apex name, do not generate links that point to an unrelated www hostname; decide the canonical name before publishing and redirect the other name consistently at the web-server layer.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Create a post with:

hexo new "Your First Article"

Hexo places a Markdown file in source/_posts. Its front matter controls the title, date, categories, tags and other theme-supported fields. Write the article body below the front matter. Images and other source assets can be kept in the project according to the theme’s documented conventions, then checked in with the post.

Rank #2
Windex Gaming Cleaning Wipes, Pre-Moistened Wipes to Instantly Clean all Gaming Gear and Electronics, Resealable Packaging for a Freshness Lock, 25 count (Pack of 1)
  • WINDEX GAMING WIPES: effortlessly clean all your gaming gear and gaming electronics in one easy step with our new Windex Gaming Wipes
  • AMMONIA FREE: our ammonia-free formula is safe to use on all of your favorite gaming equipment like consoles, headsets, controllers, screens, keyboards, and more
  • PRE-MOISTENED WIPES: each wipe instantly removes dust, dirt, and stubborn smudges and fingerprints leaving a streak-free shine
  • ANTI-STATIC: great for cleaning and wiping down your gaming gear and electronics leaving behind no visible residue
  • COMPACT RESEALABLE PACKAGE: store your pack of Windex Gaming Wipes anywhere in your home for whenever a quick and easy wipedown is needed

Run a clean local build when an old page, deleted asset or changed theme continues to appear:

hexo clean
hexo generate
hexo server

hexo clean removes generated files and cache data; hexo generate recreates the production tree in public. Inspect the preview at http://localhost:4000/ before transferring anything to the VPS. Check navigation, post URLs, images, feeds, pagination and links from both the home page and a deep article URL.

Choose where the build runs

All approaches produce the same deployable artifact: the contents of public. The differences are operational rather than a change to Hexo itself.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Approach Build location File transfer Rollback characteristics Best fit
Local build Your workstation Git checkout, SSH copy or rsync Good when releases are copied into versioned directories One author or a small site that is edited locally
VPS build A checkout on the server Pull source, install dependencies and generate on the VPS Requires careful separation between source and web root Editors who prefer server-side administration
CI build A controlled build runner Artifact upload, SSH copy or deployment agent Strong audit trail when each build has a commit and release directory Multiple contributors or repeatable automated publishing
Hexo deploy plugin Where the Hexo command runs Determined by the configured plugin Depends on the plugin’s destination and rollback facilities Teams that already maintain a supported deployment plugin

Hexo also supports hexo deploy -g, which generates the site before invoking a configured deployment plugin. A plugin is optional; NGINX only needs the resulting files.

Publish only the generated files to the VPS

A release-oriented layout keeps source and served content separate. For example, create a directory such as /var/www/hexo/releases/<release-id> for each build and make /var/www/hexo/current point to the selected release. The release identifier can be a Git commit or timestamp. The exact layout is your operational choice, but the web server should never point at the project directory containing package.json, .git or unpublished source.

From the build machine, one simple transfer pattern is:

rsync -az --delete public/ [email protected]:/var/www/hexo/releases/2026-10-15-1200/

Use an SSH key restricted to deployment work, and confirm the destination path before using --delete. That option removes files in the destination that no longer exist in the generated site; it is useful for preventing deleted posts or assets from lingering, but a typo in the destination can delete the wrong directory.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
LISEN Cell Phone Stand Phone Holder for Desk, Office Decor Gadgets for Men
  • Ergonomic & Adjustable Design: Fight "text neck" and improve your posture. Designed for comfort, it offers an adjustable height (7.1in-8.5in) (1.4in adjustable range) and angle (5°-85°) Please note: cell phone stand is only 9 inches tall—the length of a standard pencil
  • Without blocking subtitles Perfect for office desk Tiktok Face Time Zoom video—this is the ultimate kitchen desk essential for phones! Perfect viewing experience while reducing neck back strain, A must-have for gamers streamers desk, and anyone who values both style and support!
  • Sleek & Stable Design fits Otterbox Case: Say goodbye to bent cables, tangles, and tip-overs! LISEN’s stylish adjustable desk phone holder features a built-in charging hole and smart cable management, keeping your phone secure and your workspace clutter-free cool gadgets for men
  • ANTI-SLIP DESIGN free hands: The under 10.00 items easy gadgets back and the bottom of this kitchen essentials for women are fully covered by anti-skid silicone, which LISEN stand up desk decor can provide maximum protection device from any scratches and slides
  • Your Perfect Viewing Companion:If your product arrives damaged or breaks within 365 days, reach out to LISEN for a quick and hassle-free solution. Struggling with assembly, like tightening the screw? We’ve got your back! Your experience matters to us. (Product including: phone Holder stand*1, screw*1, hexagon screwdriver*1, specification*1)

After copying, verify that the destination contains index.html and the expected subdirectories. Change ownership and permissions so the NGINX worker can read files while the deployment account can create new releases. The precise user and group names differ by distribution and by how NGINX was installed, so inspect them instead of assuming a universal value.

Once a release is complete, switch the current symlink atomically to that directory. If a deployment is interrupted, NGINX continues serving the previous complete release rather than a half-copied tree. Keep older releases until you have validated the new one, then remove them according to your storage policy.

Configure NGINX for the Hexo output

NGINX’s root directive defines the filesystem directory used to find a requested file; the request URI is appended to that path. The index directive selects the file returned for a directory request. A minimal HTTP server block is:

server {
    listen 80;
    listen [::]:80;
    server_name example.com www.example.com;

    root /var/www/hexo/current;
    index index.html;

    location / {
        try_files $uri $uri/ =404;
    }
}

Replace the hostnames and root with your chosen canonical domain and release path. The try_files rule checks the requested file and directory and returns a 404 when neither exists. It prevents an accidental application fallback from hiding missing static files.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Enable the server block using your distribution’s normal NGINX site configuration method, then run its configuration test before reloading the service. Many installations use sudo nginx -t, but the service and enabled-site paths vary. Reload only after the test reports a valid configuration:

sudo nginx -t
sudo systemctl reload nginx

Request the site by hostname, not just by IP address. If another server block answers, check that the requested hostname exactly matches server_name and that the intended configuration is enabled. A 404 normally means the URI-to-file mapping or the configured root is wrong; confirm that the root actually contains index.html and that every parent directory is searchable by the NGINX process.

Point DNS at the VPS

Create an A record for the domain’s IPv4 address. If the VPS has working IPv6 connectivity, create an AAAA record for that address as well. Do not publish an AAAA record that the server or firewall cannot actually serve; clients may prefer IPv6 and appear to fail even while IPv4 works.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Ledagic IC+RGBW USB Powered Led Light Bar with App & Remote Control, 2 Pack
  • Easy Installation: Our gaming lights have been designed to enhance your entertainment experience. Simply position the led light bar next to your TV or game console to create a game room environment with ease. They come with USB power and a 60 inch cord for direct mounting and mobility
  • Audio Syncing & Extensive Mode: The built-in high-sensitivity music sensor allows you to sync the TV led lights to your favorite music. Lights react and move to the beat of music, film and game audio, creating an incredible immersive sound and light experience – and all without the need for an additional hub. You can choose from 64+ patterns, including strobe, illusion, jump, energy, gradient, running, chasing, fluttering mode etc. Each mode can be applied to different scenes
  • 64+ Chasing IC+RGB & W Effect: The independent control design of IC+RGB and white all-in-one multifunctional rgbw led bar lights monitor backlight allows you to easily switch the led lights for desk between IC+RGB and white to enjoy a variety of lighting effects, you can choose white lighting mode with high brightness for better illumination when working, etc. Choose IC+RGB lighting mode when you need to create an entertaining atmosphere for the light show, 16 million colours of Color changing rgb light bar let you dance to the beat and create a dynamic party atmosphere
  • Dynamic and Dimmable Lights: 1%-full brightness free brightness adjustment gives you the flexibility to adjust dimmable led light bar for room decorations or a variety of occasions
  • USB Powered: USB light bars for room can be powered by powernank, usb charger, TV, Monitor, laptop PC mainframe, making behind TV led lighting bar easy to install in any location.TV led lights are powered by the TV usb interface / PC mainframe, can be turned on/off synchronously with TV / PC

DNS changes become visible according to the registrar and DNS provider’s TTL behavior. Before requesting a certificate, verify that the names resolve to the intended VPS from more than one network and that inbound HTTP traffic can reach port 80. A DNS record pointing at an old server, proxy or private address will cause certificate validation to fail.

Enable HTTPS with Certbot and NGINX

Install Certbot and its NGINX integration using packages appropriate for your Linux distribution. Once the HTTP server block is reachable for both names, request the certificate:

sudo certbot --nginx -d example.com -d www.example.com

The NGINX plugin obtains the certificate and can modify the server configuration. Review its proposed redirect policy and choose whether HTTP should permanently redirect to HTTPS. Test the apex and www names separately; a certificate covering only one name does not secure the other.

NGINX’s SSL configuration needs an SSL-enabled listen directive plus certificate and private-key paths. Certbot normally writes these paths for you. The private key must be protected from ordinary users while remaining readable by the NGINX master process. Do not place private keys inside the Hexo project or the publicly served directory.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

After issuance, check all of the following:

  • Opening the HTTP URL follows the redirect you selected.
  • The HTTPS certificate covers every hostname you publish.
  • A deep post URL works over HTTPS, not only the home page.
  • Images, stylesheets, feeds and theme scripts load without mixed-content errors.
  • The Certbot installation’s documented renewal mechanism runs successfully before the first certificate expires.

Do not describe renewal as working until you have run the installation’s supported renewal test or otherwise observed a successful renewal path on the target VPS.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Use a repeatable update workflow

For each publishing cycle, edit and review the source, generate a clean build, transfer it as a complete release and then switch NGINX to that release.

  1. Update the project and commit the source changes in Git.
  2. Run hexo clean and hexo generate.
  3. Preview locally with hexo server and test representative article, category and asset URLs.
  4. Copy the new public directory to a new release path, not directly over the active directory.
  5. Check the copied release for index.html, expected assets and correct permissions.
  6. Switch /var/www/hexo/current to the new release.
  7. Request the site over HTTPS and inspect the NGINX error log if a page fails.
  8. Retain the previous release until the new one has passed your checks; switch back to it if necessary.

This process makes rollback a path change rather than a second build. If you use an in-place synchronization instead, take a backup or keep a prior artifact so a bad build can be restored.

Best Value
Sale
HUANUO FlowLift™ Dual Monitor Stand, Fully Adjustable Gaming Monitor Desk Mount for 13–32″ Computer Screens, Full Motion VESA 75x75/100x100 with C-Clamp & Grommet Base, Each Arm Holds 4.4 to 19.8 lbs
  • Compatible with Wide Screens - To ensure compatibility with the dual monitor mount, your each monitor must meet three conditions at the same time: First, computer screens size range: 13 to 32 inches. Second, screen weight range: 4.4 to 19.8 lbs. Third, the back of the monitor screen must have VESA mounting holes with a pitch of 75x75mm or 100x100mm.
  • Regarding the compatibility with desks - Your desk must meet three conditions at the same time: First, desk material: Only wooden desks are recommended, plastic or glass desks cannot be used. Second, desk thickness range: 0.59" - 3.54". Third, the bottom of the desk should not have any cross beams or panels, as this will interfere with installation. We recommend carefully checking that your desk and monitors meets all above conditions before purchasing.
  • Dual C-Clamp Hold - Worried your dual monitors might wobble or slip? Our upgraded base uses a larger platform plus a dual C-clamp structure to lock the dual monitor arm firmly to your desk. Each arm safely keeps your screens steady while you type, click and game—no shaking, no sliding, just a clean and secure setup you can trust every day. It also provides Grommet Mounting installation choice, both options ensure stable and secure fixation for your 0.59" - 3.54" desk.
  • Full-Motion Adjustment For Comfortable View - Pull the screen closer when you’re deep in a spreadsheet, push it back to watch videos, or rotate to portrait for coding — moving everything smoothly with just one hand. The monitor stand offers +85°/-50° tilt, ±90° swivel and 360° rotation. Raise your monitor up to 15.75″ to support a healthy sitting posture. Whether you’re working from home, gaming through the night, or switching between video calls and documents, getting the screens to your natural line of sight helps relieve neck, shoulder and back strain so you can stay focused longer with less fatigue.
  • Keep Your Desk Organized: By lifting both screens off the desktop, this dual monitor stand opens up valuable space for your keyboard, notebook, docking station or a simple, clutter-free work area. Built-in cable management guides wires along the arms, keeping cords out of sight and out of the way. Enjoy a tidy, modern workstation that looks as good as it feels to use.

Troubleshoot common failures

hexo: command not found

The global npm executable directory may not be on your shell’s PATH. Use the project-local runner instead:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
npx hexo generate
npx hexo server

Alternatively, add the npm global bin directory to the account that runs Hexo and open a new shell. Check that node, npm and the Hexo executable resolve to the versions you expect.

EACCES during npm installation

Do not bypass npm permission errors by running the install as root or repeatedly adding sudo. Use a user-owned Node.js installation or correct the ownership and npm prefix for the account that builds the project. A root-owned project often causes a second set of permission failures during later updates.

NGINX returns 404 for the home page

Confirm that the configured root is the generated directory, not the Hexo source directory, and that it contains index.html. Check whether the request is reaching the expected server_name. Then review the try_files rule and NGINX error log for the exact filesystem path it attempted.

The wrong website appears

The hostname may be resolving to a different IP, or another NGINX server block may be handling the request. Verify A and AAAA records, request the site with the intended hostname, and ensure the matching server block is enabled. Testing by IP alone can select a default server and hide a hostname configuration problem.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

HTTPS certificate issuance fails

Confirm that every requested name resolves to this VPS and that inbound port 80 is reachable from the public internet. ACME HTTP validation needs to reach the server on port 80. Firewalls, an old A or AAAA record, an upstream proxy and an already-running service that occupies the validation port can each prevent issuance.

New content is missing after deployment

Run hexo clean before generating again, inspect the new public tree, and verify that the transfer copied the complete directory. If the page exists on disk but an old version is visible, check browser or proxy caching and confirm that NGINX’s current path points to the new release.

Operational checklist

  • Node.js meets the Hexo version’s compatibility requirement on every build machine.
  • Git source, package metadata and credentials are outside the NGINX document root.
  • The generated public directory contains the exact files being served.
  • NGINX uses index.html and a deliberate missing-file policy.
  • File ownership allows NGINX to read while the deployment account can publish.
  • DNS A and, if used, AAAA records point to reachable VPS addresses.
  • Port 80 is reachable for ACME validation, and HTTPS is tested for every hostname.
  • Deployments are identifiable and reversible rather than overwriting the only copy.
  • Backups, monitoring and IPv6 support are checked with your VPS provider; none is guaranteed by Hexo, NGINX or Certbot.

With this arrangement, Hexo handles authoring and generation, while the VPS performs a narrow and dependable job: serve the contents of public over NGINX and protect the domain with TLS. Keeping those responsibilities separate makes updates, diagnosis and rollback much simpler than exposing the entire project to the web.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More quests from Patch Notes

  1. How to Set Up a RedM (RDR2) Server in 2026: License Key, txAdmin and server.cfg, Step by StepBlog11min
  2. Best RedM (RDR2) Server Hosting in 2026: Comparing Four Hosts on Slots, Memory and PriceBlog10min
  3. How to Host a Mindustry Server in 2026: server-release.jar, Port 6567 and the Commands That MatterBlog7min
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.