What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
A bare Git repository and a post-receive hook can turn a push to your production branch into a complete Hugo deployment on your VPS. The hook checks out the received source, builds Hugo’s public tree, and publishes that tree for Nginx to serve. Keep the Git repository, build workspace, and web document root separate, run the hook as a dedicated account, and clean the destination on every build so removed or unpublished pages do not remain online.
Need a server to try this on? Antihost offers Linux VPS plans with NVMe storage, full root access and a 14-day free trial.
What the deployment pipeline does
This setup is a small, self-hosted continuous-deployment system. Your local machine pushes Hugo source to a bare repository on the VPS. Git runs the repository’s hooks/post-receive script, which checks out the selected revision into a private workspace, executes Hugo, and publishes the generated files. Nginx serves only the generated directory; it never serves the repository or the source checkout.
As an Amazon Associate I earn from qualifying purchases.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →The sequence is:
- You commit a change and push the production branch over SSH.
- The bare repository receives the objects and invokes
post-receive. - The hook ignores every ref except the configured production branch.
- Git checks out that revision into the build workspace.
- Hugo renders the site into a destination directory, normally called
public. - Only a successful build is made available under Nginx’s document root.
Hugo’s deployment documentation describes the same fundamental choice: push source to a Git repository and let a platform build and deploy it, or build locally and transfer the generated files to the host. A VPS hook keeps the build under your control while avoiding a separate hosted runner.
Use three separate directories
Do not combine the repository, checkout, and web root. Separation limits accidental exposure and makes it possible to inspect or replace a build without changing Git history.
#1 Best Overall
- 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.
| Role | Example path | What belongs there |
|---|---|---|
| Bare repository | /srv/git/site.git |
Git objects and hooks; no working tree and no files intended for visitors. |
| Build workspace | /srv/build/site |
The checked-out Hugo source, themes, modules, and configuration used by the hook. |
| Nginx document root | /var/www/site/public |
Only the generated HTML, CSS, JavaScript, images, feeds, sitemap, and other publishable files. |
Use a dedicated deployment account for all three operations. The account needs to write the repository and build directories and publish the destination, but it should not be a general-purpose administrator. Nginx only needs read access to the generated tree. If your distribution uses the www-data group, you can assign the destination to that group after a successful build; adapt the ownership to your VPS.
Prerequisites and decisions
VPS and DNS
- An Ubuntu or comparable Linux VPS with SSH access and enough storage for the repository, checkout, and generated site.
- A hostname whose DNS record points to the VPS.
- Nginx installed and able to bind the HTTP and HTTPS ports.
- Git and the Hugo executable installed for the deployment account or available at a fixed path such as
/usr/local/bin/hugo.
Choose the Hugo edition before installing
Hugo’s Linux installation guidance lists standard, deploy, extended, and extended/deploy editions. Select the smallest edition that supports your project. Sass or SCSS processing requires an extended-capability edition. Direct deployment from Hugo to object storage requires a deploy edition. A site that only renders Markdown and publishes to a VPS generally does not need the deploy edition, but it may still need extended features used by its theme or asset pipeline.
Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallChoose the production branch
The examples use main, represented in receive-hook input as refs/heads/main. Decide whether that branch is always production or whether a separate branch is promoted after review. The hook must compare the complete ref name and exit without building for every other branch.
Create the deployment account and directories
Run administrative commands as root or through sudo; run Git and Hugo as the deployment account. The exact username is your choice. The following layout follows the architecture above:
sudo useradd --system --create-home --home-dir /srv/deploy --shell /usr/sbin/nologin deploy
sudo install -d -o deploy -g deploy -m 0750 /srv/git
sudo install -d -o deploy -g deploy -m 0750 /srv/build
sudo install -d -o deploy -g deploy -m 0750 /srv/build/site
sudo install -d -o deploy -g deploy -m 0750 /var/www/site/public
sudo git init --bare --initial-branch=main /srv/git/site.git
If your Git version does not support --initial-branch, initialize the bare repository without that option and let the first push create main. Ensure the deployment account can execute Hugo and read any private modules or theme files required by the build.
Give Git a restricted SSH entry point
Create an SSH key used only for this repository. Do not reuse a personal administrator key. Place the public key in the deployment account’s authorized_keys file and restrict it so the key can submit Git data but cannot open an unrestricted shell. A typical entry uses Git’s forced command, disables forwarding, and permits no terminal:
Rank #2
- 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
command="git-shell -c "$SSH_ORIGINAL_COMMAND"",no-port-forwarding,no-agent-forwarding,no-X11-forwarding,no-pty ssh-ed25519 AAAA... production-deploy
Use the key’s actual public-key line in place of the shortened example. Confirm that the forced command matches the repository path you intend to expose. The important property is that an SSH connection made with this key can run the Git receive operation, not arbitrary shell commands. Keep administrative access on a separate key and account.
From your workstation, add the bare repository as a remote:
git remote add production deploy@example-vps:/srv/git/site.git
Replace the account, hostname, and path with your values. Before enabling automatic publication, make a harmless test commit so you can observe the first receive-hook run.
Install and verify Hugo for the hook
Install the Hugo edition and version required by the site. Verify the executable as the deployment account, not only as an administrator:
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Repair Windows errors before they cause bigger problems3Scan for outdated or missing drivers - takes under a minutesudo -u deploy /usr/local/bin/hugo version
sudo -u deploy git --version
Pin the executable path in the hook. Hooks run with a minimal environment, so relying on an interactive shell’s PATH is a common reason a manual build succeeds while a push fails. If the project uses Hugo modules, make sure the deployment account has the required module cache access and that the repository contains any files needed to resolve those modules.
Install the post-receive hook
Create /srv/git/site.git/hooks/post-receive, make it executable, and keep it owned by the deployment account. Git sends one line for each updated reference on standard input: the old object ID, the new object ID, and the full ref name. The hook below builds only main:
Rank #3
- 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)
#!/bin/sh
set -eu
REPO=/srv/git/site.git
WORK=/srv/build/site
DEST=/var/www/site/public
BRANCH=refs/heads/main
while read oldrev newrev refname; do
[ "$refname" = "$BRANCH" ] || continue
git --work-tree="$WORK" --git-dir="$REPO" checkout -f main
/usr/local/bin/hugo
--source "$WORK"
--destination "$DEST"
--cleanDestinationDir
--environment production
chown -R www-data:www-data "$DEST"
done
sudo chown deploy:deploy /srv/git/site.git/hooks/post-receive
sudo chmod 0750 /srv/git/site.git/hooks/post-receive
set -eu makes an unset variable or failed command stop the hook. The explicit ref check prevents a feature-branch push from replacing production. Adapt the repository, workspace, destination, branch, Hugo path, and web-server ownership to your system.
Why --cleanDestinationDir matters
Hugo can leave files in the destination when a page is renamed, deleted, changed to a draft, expired, or given a future publication date. Those files can remain reachable even though they are no longer produced by the current source. --cleanDestinationDir removes stale output during the build. You can set the equivalent cleanDestinationDir configuration value, but an explicit production flag makes the behavior visible in the hook.
Build into a temporary directory for safer publication
The compact hook writes directly to the document root. A safer variant builds elsewhere and updates the live tree only after Hugo exits successfully. This preserves the previous good output when a build fails and lets Nginx continue serving it:
#!/bin/sh
set -eu
REPO=/srv/git/site.git
WORK=/srv/build/site
DEST=/var/www/site/public
BRANCH=refs/heads/main
while read oldrev newrev refname; do
[ "$refname" = "$BRANCH" ] || continue
git --work-tree="$WORK" --git-dir="$REPO" checkout -f main
TMP=$(mktemp -d /srv/build/site-release.XXXXXX)
trap 'rm -rf "$TMP"' EXIT
/usr/local/bin/hugo
--source "$WORK"
--destination "$TMP"
--cleanDestinationDir
--environment production
rsync -a --delete "$TMP"/ "$DEST"/
chown -R www-data:www-data "$DEST"
trap - EXIT
rm -rf "$TMP"
done
This version requires rsync. The --delete option makes the live tree match the successful build, including removals. If you use concurrent pushes, serialize hook executions or reject a second build while one is running; otherwise two builds can race to update the same destination.
Log every build
Redirect Hugo’s standard output and error to a log that the deployment account can append to, or run the hook under a service manager that captures them. Include the commit or ref in the log message. A push client may report only that the remote hook failed; a persistent log gives you the actual template, content, module, or permission error.
Configure Nginx to serve only generated output
Point the site’s Nginx server block at /var/www/site/public, set the production hostname, and configure TLS for that hostname. Do not set root to /srv/git/site.git or /srv/build/site. Those locations contain Git metadata, source content, and possibly secrets used by the build.
Recommended Free Tools
Rank #4
- 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
server {
listen 80;
server_name example.com www.example.com;
root /var/www/site/public;
index index.html;
location / {
try_files $uri $uri/ =404;
}
}
Use your existing HTTPS configuration or certificate automation for TLS. Validate before reloading:
sudo nginx -t
sudo systemctl reload nginx
Reload Nginx only after nginx -t succeeds. A static Hugo site normally needs no application upstream, process supervisor, or runtime interpreter; Nginx reads the files Hugo generated.
Make the first production push
Use a harmless change such as a small text edit. Push the exact production branch:
git add .
git commit -m "Test production deployment"
git push production main
Then check the receive output and the server log. The hook should show a checkout followed by a successful Hugo exit. The destination should contain at least the generated home page and the assets your site references. Visit the hostname over HTTPS and inspect the response headers and page source to confirm Nginx is serving the new revision.
Acceptance checks before relying on automation
- Account: confirm the hook runs as the deployment account and that the SSH key cannot obtain an interactive shell.
- Revision: verify that a push to the production branch changes the checkout and a push to another branch does not publish anything.
- Build: confirm Hugo exits successfully and that templates, assets, feeds, and the sitemap are present where expected.
- Web serving: check the new page through Nginx, including its canonical host and TLS endpoint.
- Deletion: remove or rename a page, push, and verify that its old path disappears after the clean build.
- Unpublished content: mark a page as draft, expired, or future-dated and confirm it is not left in the live tree.
- Failure behavior: introduce a controlled template error and verify that the hook fails visibly while the last successful output remains available when using a temporary build directory.
These checks are operational acceptance criteria. They are not a substitute for monitoring: keep watching hook logs and disk usage after launch.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Diagnose common failures
The push succeeds but nothing changes
Check that the client pushed the branch the hook accepts. A hook that compares refs/heads/main will intentionally ignore tags, pull-request refs, and other branches. Confirm the hook is executable and located inside the bare repository’s hooks directory, not in the build checkout.
Best Value
- 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.
“hugo: not found” or a module cannot be read
Use an absolute Hugo path and test it with sudo -u deploy. Inspect permissions on the module cache, theme directory, and any private repository credentials. Hooks do not inherit your login shell, aliases, or user-level environment files.
Free tools Windows power users keep installed
One-click scans. No signup required.
Nginx returns a 403 or 404
Check that the destination exists, contains index.html, and is readable and traversable by the Nginx worker account. Verify the server block selected the expected hostname and that nginx -t passed before the reload. A successful Hugo build in the wrong destination is indistinguishable from a missing deployment until you compare the configured paths.
Old URLs remain after content is removed
Build with --cleanDestinationDir or the equivalent configuration setting. If you use a staged build, retain rsync --delete (or another deletion-aware publish step) so files absent from the new tree are removed from the live tree.
A bad commit replaced the site
First restore the last known-good source revision through normal Git history: revert the offending change, commit the revert, and push the production branch. If your team maintains a release branch, promote the known-good commit according to that process. Keep generated output out of Git; the source commit and hook log are the audit trail.
Rollback, audit, and operational safeguards
Git gives you an immutable reference to every pushed source revision, while the hook log should record which revision was built and whether Hugo succeeded. For a quick rollback, push a revert or a branch pointer that restores the desired source state; the same hook then rebuilds it. Do not edit files manually inside /var/www/site/public, because the next deployment will overwrite them.
- Restrict write access to the repository, workspace, and destination to the deployment account and the web-server read path.
- Keep the bare repository and workspace outside every Nginx
root. - Use a dedicated SSH key with forwarding and terminal access disabled.
- Pin Hugo and theme/module versions so a rebuild is reproducible.
- Monitor available disk space; the repository, checkout, temporary builds, and logs all consume storage.
- Serialize deployments if more than one push can arrive at once.
- Back up the bare repository if its history is part of your recovery plan.
How this compares with other Hugo deployment methods
| Method | Build location | Strengths | Trade-offs |
|---|---|---|---|
| VPS bare repository and hook | Your VPS | One push publishes directly; full control over the host, keys, logs, and web server; no separate runner required. | You maintain Linux updates, Git access, Hugo versions, TLS, storage, and the deployment script. |
| Managed Git CI/CD | A hosted runner | Hosted build environments, clearer job history, easier previews, and less server maintenance. | You must configure deployment credentials and trust the runner; build minutes, preview features, or storage may be subject to the provider’s plan. |
| Local build and file transfer | Your workstation | Simple server requirements; useful for a very small site or an offline-controlled release. | Publication depends on one workstation, is easier to perform inconsistently, and needs a secure transfer and cleanup strategy. |
hugo deploy to object storage |
Where you run Hugo | Targets services such as Amazon S3, Azure Blob Storage, and Google Cloud Storage; supports dry runs, confirmations, deletion limits, worker controls, and CDN invalidation options. | Requires object-storage credentials, bucket policy, and a different edge-serving design than an Nginx VPS. |
Choose the hook when direct control and a short push-to-publish path matter more than minimizing server administration. Choose managed CI when previews, centralized audit trails, and disposable builders are more valuable. Hugo’s official deployment methods document both source-driven builds and local-build transfers; neither is universally superior.
Production checklist
- Create a non-login deployment account and separate repository, workspace, and document-root directories.
- Install the Hugo edition required by your modules and asset pipeline; verify it as the deployment account.
- Initialize a bare repository and add an executable
post-receivehook. - Restrict the SSH key with a forced Git command and disable forwarding and terminals.
- Make the hook accept only the intended production ref.
- Build with the production environment and clean the destination on every successful release.
- Prefer a temporary build directory so a failed build does not replace the last good output.
- Point Nginx only at the generated directory, validate with
nginx -t, and reload. - Test a harmless push, a deletion, an unpublished page, and a deliberate build failure.
- Keep logs, source history, backups, and a documented rollback path.
When to change the design
A hook on one VPS is intentionally small. Reconsider it when you need pull-request previews, builds for several sites, parallel environments, secret scanning, approval gates, or multiple production regions. At that point, a managed CI runner or a dedicated build service can separate compilation from the web host. You can still keep Nginx as the final static-file server; only the trigger and build ownership change.
For a single Hugo site, however, the bare-repository pattern remains easy to understand and audit: Git receives source, the hook builds a clean public tree, and Nginx serves that tree. The safety of the arrangement comes from the boundaries—restricted SSH, branch filtering, clean output, and a previous release that remains intact until the new build succeeds.
Quick Recap
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.




