Deployment

How to publish a static site, a Next.js export or a Vue app on shared hosting or a modern platform.

Which files to upload

FormatBuild commandUpload
HTMLNoneThe template folder's contents. You can leave out scss/ and .map files.
Next.js (static export)npm run buildThe contents of out/
Vuenpm run buildThe contents of dist/

Other products, such as scripts and back ends, run on a server. See their category's setup guide, for example Scripts & Source Code.

Shared hosting

This works on hosts with a control panel, such as Hostinger or cPanel.

  1. Build the site if your format needs it.

  2. Open your host's File Manager, or connect with FTP.

  3. Go to the web folder for your domain, usually public_html.

  4. Upload the files so that index.html is directly inside that folder, not inside another folder.

  5. Open your domain and click through the pages.

Zip them first, upload the ZIP, and extract it in the File Manager. It is much faster than uploading thousands of small files.

Vercel, Netlify and similar platforms

Connect your Git repository, or upload the build folder. Use these settings if you are asked:

FormatBuild commandOutput folder
Next.jsnpm run buildout
Vuenpm run builddist
HTMLLeave emptyThe project root

Vue: make reloads work

Vue templates use clean addresses such as /about, which only exist inside the app. The server has to answer every address with index.html, or reloading a page shows a 404.

Apache or LiteSpeed

Add a .htaccess file next to index.html:

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /
  RewriteRule ^index\.html$ - [L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . /index.html [L]
</IfModule>

Nginx

location / {
  try_files $uri $uri/ /index.html;
}

Netlify

Add a file named _redirects to public/:

/*  /index.html  200

Publishing in a subfolder

If your site lives at an address like example.com/shop/ rather than the domain root, tell the project before building:

Forms need a back end

Website templates and landing pages come with designed forms, but a form in a browser can't send email on its own. Before you launch, connect each form in one of these ways:

Whichever you choose, check the input on the server, add spam protection, and send a test message before going live.

Before you go live