UpCloud
Effortless global cloud infrastructure for SMBs
Introducing
If you’re interested in what we have to offer, contact sales or fill out a contact form.
Our support live chat is available for our customers 24/7. You can also email our support team.
Send us an email to give feedback or to say hello.
Start a new journey
Why Partner with UpCloud?
I’ve been passionate about the hosting industry since 2001. Before founding UpCloud, my first company grew to become one of Finland’s largest shared web hosting providers, serving over 30,000 customers. Along the way, I faced the same challenges many of you know well—24/7 on-call responsibilities, solving technical issues, and managing customer inquiries.
At UpCloud, we’ve designed a platform that solves these challenges, offering reliability, scalability, and unparalleled support. We understand the pressures you face because we’ve been there too. Partner with us, and let’s help you focus on growing your business while we handle the rest.
Sincerely, Joel Pihlajamaa CTO, Founder
Login
Sign up
Updated on 6.6.2025
Developers need fast, secure, and efficient ways to build modern websites—whether it’s a personal blog, product landing page, or documentation site. A static site generator like Hugo is that’s fast, easy to use, and highly customizable is a great solution to deploy and pull content quickly. Unlike traditional CMSs that rely on databases and server-side rendering, Hugo generates pre-rendered static HTML files, making your site lightning-fast, secure, and easy to deploy.
But performance doesn’t stop at build time. To fully take advantage of Hugo’s speed, you need reliable hosting that can keep up. UpCloud offers just that—scalable, SSD-backed infrastructure, custom firewalls, and fast networking to ensure your site stays online and loads in seconds.
In this guide, we’ll walk you through everything you need to build a Hugo static site, configure it for optimal performance and SEO, and deploy it to UpCloud for fast delivery.
Hugo is an open-source static website framework designed for developers who prioritize speed, simplicity, and flexibility. As one of the most popular static site generators, Hugo empowers you to build high-performance websites without the overhead of traditional, database-driven CMS platforms like WordPress.
Built in Go (Golang), Hugo is exceptionally fast and capable of generating thousands of pages in seconds. This speed makes it ideal for developers who want a responsive workflow and quick deployment cycles. When you run a Hugo build, it converts your content (written in Markdown or other supported formats) into pre-rendered static HTML files, ready to be served by any web server or CDN. This approach results in fast page loads, minimal server-side dependencies, and fewer security vulnerabilities.
While Hugo is not a CMS in itself, it’s flexible enough to work seamlessly with headless CMSs like Netlify CMS, or Sanity. This allows teams to combine the performance of static sites with the convenience of visual content editing, making Hugo suitable for both solo developers and collaborative teams.
When it comes to building modern static websites that are fast, secure, and easy to manage, Hugo stands out as one of the best tools available. Here’s why:
When you pair it with UpCloud’s high-performance hosting, you get a deployment setup that’s both powerful and efficient—ideal for everything from personal blogs to large documentation sites. UpCloud offers features that align perfectly with the way Hugo works like:
Before you can deploy your Hugo static website to a host like UpCloud, make sure you have the right tools and access in place. Here’s what you’ll need:
Hugo Installed LocallyYou’ll need to install Hugo on your development machine to build your site. To verify your Hugo installation, open a terminal and run: hugo version. This command will display your installed version if Hugo is properly set up. If it’s not installed yet, follow the official Hugo install guide for your operating system.
hugo version
An UpCloud ServerTo deploy your website, you’ll need access to a server or cloud instance on UpCloud. If you haven’t created one yet, you can sign up and spin up a cloud server in minutes.
Basic Command Line KnowledgeFamiliarity with terminal commands is essential. You’ll be using the command line to build your site, configure SSH access, and push files to your UpCloud server.
Once you have confirmed that everything needed for this application is in place, let us get started.
First of all, let’s look at how to install Hugo on our computer(macOS, Windows, and Linux users):
You can choose the method based on your operating system:
For macOS (using Homebrew):
bash brew install hugo
For Windows (using Chocolatey):
powershell choco install hugo -confirm
For Ubuntu/Debian-based Linux (using apt):
bash sudo apt update sudo apt install hugo
For RedHat/CentOS-based Linux (using yum):
bash sudo yum install hugo
To make sure Hugo is installed correctly, run:
bash hugo version
Once installed, you can initialize a new Hugo project by running:
bash hugo new site my-documentation
Replace my-documentation with your desired project name. This command creates the folder structure for your new Hugo site.
Once created, this is what the project structure will look like:
perl my-documentation/ ├── archetypes/ # Content templates ├── content/ # Your Markdown pages ├── layouts/ # Custom HTML templates ├── static/ # Static assets like images, CSS, JS ├── themes/ # Site themes ├── config.toml # Main configuration file
Once your Hugo project is set up, it’s time to start building content, applying a theme, and testing your site locally. The Hugo static site generator makes this process fast and efficient.
1. Create Pages Using Markdown
Hugo uses Markdown files for content, which makes writing and organizing pages easy. To create a new page or post:
bash hugo new posts/blog.md
This creates a new Markdown file in the content/posts/ directory. Open the file and start writing your content using plain Markdown syntax.
content/posts/
Each content file starts with front matter (in YAML, TOML, or JSON), where you define metadata like title, date, and draft status. Once written, Hugo’s templating system will render this Markdown into a fully styled HTML page based on your chosen theme.
2. Configure a Theme
For the sake of this demo, we will be using an free theme from Hugos’s page for this documentation project. Hugo’s theming system allows you to quickly change the look and feel of your website.
You can configure your projects to use this theme using the following commands:
bash cd my-documentation git init git submodule add https://github.com/alex-shpak/hugo-book themes/hugo-book cp -R themes/hugo-book/exampleSite/content.en/* ./content
This command creates a folder called Themes in your project directory, which consists of all the components of the theme selected.
To preview your site locally to ensure everything looks and works as expected, run the following command in your in your terminal to start the Hugo development server.
bash hugo server
The theme we are working with should render like this in your browser. Since this is not exactly what we want in our documentation, you can go ahead and customize it to suite your desired needs.
3. Customize Your Theme
So since I need this theme for documentation, I will be customizing the project to suit my project documentation. I will change the title and indicate the name of the theme I am using for this article in the hugo.toml file(or config.toml file).
You can also add more files to your project to modify it with the same format as earlier. Using this command, create an html file inside your themes folder that will serve as the home page for our documentation.
bash hugo new themes/hugo-book/layout/index.html
After customizing to your project’s needs, your output should look like this
Note: you can make a lot more changes to your project to fit your needs using the Hugo docs. Now that is working, let’s proceed to build the application.
4. Build Hugo App
Once you’re satisfied with your local preview, stop the Hugo server (press Ctrl + C in the terminal).
You need to build the static files that will be deployed to the cloud server. In your terminal, within your Hugo site directory, run:
bash hugo
This command generates the complete static website in a new directory named public at the root of your Hugo project.
Now that your Hugo site is built, it’s time to deploy it to a live server so it can be publicly available. Hosting it on an UpCloud server gives you full control, performance, and flexibility. Here is how you can deploy your Hugo app to UpCloud:
1. Create an UpCloud Server
To deploy your Hugo app, start by creating a new cloud server on UpCloud. During setup, connect your SSH keys to enable secure, password-less access. UpCloud’s user-friendly dashboard makes this process straightforward, even for first-time users. For step-by-step instructions, refer to UpCloud’s official documentation.
2. Connect to the UpCloud Server
Now, access your UpCloud server using SSH by connecting with the server’s IP address and the SSH key you configured during setup. Note that UpCloud exclusively supports SSH key authentication for enhanced security. If you’re using a terminal on macOS, Linux, or Windows with WSL, run the following command:
Bash ssh username@your_server_ip_address
3. Upload Static Files to UpCloud
With your UpCloud server running, the next step is to transfer the contents of your Hugo project’s public directory to the server. We’ll use scp (Secure Copy) for this, which is a secure way to transfer files over SSH.
You will need to create a directory manually into your UpCloud server using this command(replace with your preferred name).
Bash sudo mkdir -p /var/www/myproject.com/html
Open your local terminal and navigate to the root directory of your Hugo project (the one containing the public folder) and run the following command. This takes the pre-built static files from your local Hugo project’s public directory and securely transfers them over the internet to a specific location on your remote UpCloud server.
Bash scp -r public/* <your_username>@<your_server_ip>:<remote_path>/
4. Install and Configure Nginx
To serve the static Hugo website to the public, you need a web server like Nginx installed on your UpCloud instance. Nginx is a lightweight, high-performance web server that is well-suited for serving static content like your project.
Within the UpCloud server, update the package list with the following command:
Bash sudo apt update
Install Nginx with the following command:
Bash sudo apt install nginx -y
Next, you will need to create an Nginx server block (virtual host) configuration. This tells Nginx how to handle requests for your domain.
Bash sudo nano /etc/nginx/sites-available/myproject.com
In the file created, input the following configurations and adjust the root directive to point to the directory where you uploaded your Hugo public files:
server { listen 80; listen [::]:80; root /var/www/myproject.com/html; # Adjust this path if necessary index index.html index.htm; server_name yourdomain.com www.yourdomain.com; # Replace with your domain(s) location / { try_files $uri $uri/ =404; } }
5. Configure a custom domain and SSL
To make this static website accessible via an actual domain name (e.g., http://www.allweather.world/) you will need to set up the DNS records.
Bash sudo ln -s /etc/nginx/sites-available/myproject.com /etc/nginx/sites-enabled/
Bash sudo nginx -t
Bash sudo systemctl restart nginx
6. Optional: Pair with a CDN
To boost performance even further, you can pair your UpCloud-hosted Hugo static site with a Content Delivery Network (CDN) like Cloudflare. This will help to reduce the latency, improve load times globally, and add an extra layer of security to your static website.
Hugo provides several built-in features to optimize your website’s assets directly during the build process. For instance:
Minify CSS and JavaScript: This can be used to reduce file sizes and improve loading times. Hugo can automatically minify your CSS and JavaScript files. Enable this in your config.toml (or config.yaml) under the [minify] section:
config.toml
config.yaml
minify
Ini, TOML [minify] minifyOutput = true [minify.tdewolff.css] keepCSSDeclarationOrder = true [minify.tdewolff.js]
Setting minifyOutput = true activates minification for all applicable output formats.
minifyOutput = true
Image Optimization Tools: Hugo’s image processing functionality allows you to resize, crop, and convert images during the build. This ensures that you serve appropriately sized images to different devices, reducing bandwidth consumption and improving load times. For example, in your content files or templates, you can use the resources.Get and .Resize methods:
image
resources.Get
.Resize
Code snippet {{ $image := resources.Get "images/my-image.jpg" }} {{ $thumb := $image.Resize "300x webp" }} <img src="{{ $thumb.Permalink }}" width="{{ $thumb.Width }}" height="{{ $thumb.Height }}" alt="My Image">
This example resizes my-image.jpg to a width of 300 pixels and converts it to the WebP format (which often offers better compression and quality).
You can also configure Nginx on your UpCloud server for faster delivery with:
Caching: Implementing browser caching instructs the visitors’ browsers to store static assets locally after the first visit. This significantly speeds up subsequent page loads. Add the following to your Nginx server block configuration (/etc/nginx/sites-available/yourdomain.com):
/etc/nginx/sites-available/yourdomain.com
nginx location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ { expires 30d; add_header Cache-Control "public"; }
Gzip Compression: Gzip compression reduces the size of text-based assets (HTML, CSS, JavaScript, XML) transmitted over the network. Enable it in your Nginx http block (usually in /etc/nginx/nginx.conf or /etc/nginx/conf.d/gzip.conf):
http
/etc/nginx/nginx.conf
/etc/nginx/conf.d/gzip.conf)
Nginx gzip on; gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
After modifying the Nginx configuration, remember to test it with sudo nginx -t and restart Nginx with sudo systemctl restart nginx.
nginx -t
sudo systemctl restart nginx
UpCloud’s infrastructure is designed for high performance, which directly benefits your Hugo static website. Its robust and low-latency network ensures fast data transfer between the server and your visitors, contributing to quicker page load times. UpCloud’s deployment of new servers featuring AMD EPYC Turin processors also significantly enhances performance for hosted Hugo websites.
These cutting-edge CPUs offer a 30-40% performance boost and faster DDR5 memory, leading to quicker processing and reduced latency for serving static files.
Another unique feature that improves application performance is the UpCloud CLI; deploying a new cloud server with UpCloud takes but a single command. This speed and efficiency in infrastructure provisioning perfectly complements Hugo’s rapid build times.
Hugo stands out as an excellent static website generator, offering remarkable speed in build times, inherent security due to the lack of dynamic content processing, and exceptional flexibility through its theming system and content organization. Pairing Hugo with UpCloud further amplifies these benefits for your static site.
UpCloud’s infrastructure delivers superior speed and performance, ensuring your site loads quickly for visitors worldwide. Its scalable architecture allows your hosting to grow seamlessly with your website’s traffic, providing a reliable and robust foundation.
To experience this scalability and speed firsthand, start your free trial with UpCloud.
Your email address will not be published. Required fields are marked *
Comment *
Name *
Email *
Website
Save my name, email, and website in this browser for the next time I comment.
Δ
See all tutorials