SSG Guides
On statichost.eu, you can use any static site generator (SSG). The only requirement is that there is a container image that can build your site. Your site is then usually built with the normal build command for the SSG in question. (Depending on the container image, this might not always be the case - remember to check the docs for the image you use.)
Nonetheless, it might be beneficial to have a starting point for your configuration. Also, many frameworks have special considerations that you should take into account. Below we have tried to gather some useful information for some of the most popular SSG’s on statichost.
Some frameworks listed below are not exlusively static site generators, but also provide server side rendering capabilities. The instructions will be focused on generating fully static sites, since server rendering is not supported on statichost.
Note that the example configurations are for a statichost.yml
configuration
file, but they can also be used to configure the site via the dashboard.
Node.js
Build configuration depends on the specific SSG / framework used. Please see the related guide here, or consult the documentation for your SSG. Some general things to keep in mind when using Node.js, though:
- You will need to install the required packages before running your actual build
command. E.g. for
npm
you might usenpm install && npm run build
. - If you use
yarn
orpnpm
, you can enable these by runningcorepack enable
as part of your build command. See the Node.js docs.
Astro
statichost.yml
image: node:22
command: npm install && npm run build
public: dist
Server rendering is not supported on statichost. If your site uses an “adapter” for server rendering, it will not work.
Next.js
statichost.yml
image: node:22
command: npm install && npx next build && npx next export
public: out
Next.js is primarily a server framework, but can be used
to create fully static sites as well. In order to use Next.js as a SSG, please
specify export
as the output type.
Server rendering is not supported on statichost. If your site uses API routes or server rendering, it will not work.
Gatsby
statichost.yml
image: node:22
command: npm install && npx gatsby build
public: public
Server rendering is not supported on statichost. If your site uses API routes or server rendering, it will not work.
Nuxt
statichost.yml
image: node:22
# Nuxt version 3:
command: npm install && npx nuxi generate
# For version 2 (legacy):
# command: npm install && npx nuxt generate
public: public
Server rendering is not supported on statichost. If your site uses API routes or server rendering, it will not work.
Hugo
statichost.yml
image: hugomods/hugo:reg-base-0.141.0
command: hugo
public: public
If you use advanced (/“extended”) features, such as PostCSS, you might need
another image tag. The author of the
image has started adding a lot of ads on the docs site, but as there is no
official hugo image, hugomods/hugo
is still likely you
best option.
Jekyll
statichost.yml
image: jekyll/jekyll:4
command: jekyll build
public: _site
Jekyll does not have an official container image. The
above image is pretty old, so it might have a version of Jekyll that does not
work for you. One possibility would be to use the official ruby
image and
install Jekyll as part of the build itself.
Alternatively (not tested!):
image: ruby:3.4
command: gem install jekyll bundler && bundle exec jekyll build
public: _site