Website hosting

Publish a folder of HTML, build a frontend from a repository, or run server-side code. The right runtime depends on what needs to happen when a visitor requests a page.

Static release example
Sourcepublic/index.html
GET /My static site is live

Edit public/index.html and publish again to update this page.

Download the static site

From a folder of HTML to a live website

Publish prebuilt files

Upload the directory that contains index.html, your stylesheets and images. A portfolio or documentation site can ship directly from those files. Test an image and a deep link as well as the home page.

Publish a static site

Build a frontend from source

Keep the build command, manifest and lockfile with your source. Select the generated index in the output directory. Variables that the bundler embeds in browser JavaScript must be safe for visitors to read.

Configure public build variables

Serve dynamic pages

Choose PHP for server-rendered PHP projects, or run an application server for a Node.js or Python site. This gives you a place to handle form submissions, read private credentials and query a database on the server.

Compare the website runtimes

Bring your own domain

Start with the platform HTTPS address. On your deployment, including an eligible Spark site, add the CNAME and ownership TXT record from Settings. Check the same page on both hostnames before sharing the new address.

Verify a custom hostname

What produces the page?

If the HTML already exists, publish the directory that contains it. If npm generates the files, choose Built frontend. When each request needs a database lookup or a server-rendered response, choose a runtime for the language handling it.

Publish your first version

  1. Point to the public index

    For the HTML example, upload public/index.html and set MAIN_FILE to that path. Use public/index.php for the PHP example. Keep private configuration outside that directory.

  2. Build when your source needs it

    The frontend build example includes the manifest and lockfile for npm ci followed by npm run build. The default output index is dist/index.html. Adjust STATIC_BUILD_COMMAND and the index path to match your project.

  3. Check the release on HTTPS

    Start the deployment. Static and built sites try to publish their first release automatically. Check its status in Deploy and choose Publish website after changing files. Open the address in Settings and test the home page and any asset or nested route your site serves. For an app, also exercise an API route before connecting a custom domain. Eligible Spark sites can connect one too.

Read the full deployment guide

Rehearse a static website rollback

A useful time to learn how releases work is while your site still has one page. This exercise works for Static site and Built frontend, including a site built from a connected branch.

Follow the static release recovery guide
  1. Publish a version you can recognize

    Change the heading on the home page, publish the release and open the platform address. Note the heading, a linked asset and the release you just checked. The source tree and the files currently served can be different.

  2. Publish a second version

    Change the heading again and publish. Request the same address and verify the second heading and asset. For a built site, also open a nested route directly to catch missing files or a client-router fallback issue.

  3. Switch the served release

    In Deploy select the previous published release. Reload and verify the first heading and asset. The working files still contain your newer changes, so repair those before publishing the next version.

Website hosting plans

One account plan covers your deployments. Divide its memory, storage and CPU among the projects you run together.

PlanMemoryStorageCPUDeploymentsFile backupHistoryPer year
Spark256 MB512 MB25%1Every hour24 hours$0.00
Relay1 GB5 GB50%2Every 15 minutes3 days$22.50
Circuit2 GB8 GB100%4Every 15 minutes7 days$32.50
Grid4 GB15 GB200%8Every 5 minutes14 days$60.00
Fleet8 GB25 GB250%12Every 1 minute30 days$90.00
Spark1 deployment$0.00
Memory
256 MB
Storage
512 MB
CPU
25%
Deployments
1
File backup
Every hour
History
24 hours
Compare Spark
Relay2 deployments$22.50
Memory
1 GB
Storage
5 GB
CPU
50%
Deployments
2
File backup
Every 15 minutes
History
3 days
Compare Relay
Circuit4 deployments$32.50
Memory
2 GB
Storage
8 GB
CPU
100%
Deployments
4
File backup
Every 15 minutes
History
7 days
Compare Circuit
Grid8 deployments$60.00
Memory
4 GB
Storage
15 GB
CPU
200%
Deployments
8
File backup
Every 5 minutes
History
14 days
Compare Grid
Fleet12 deployments$90.00
Memory
8 GB
Storage
25 GB
CPU
250%
Deployments
12
File backup
Every 1 minute
History
30 days
Compare Fleet

Prices in USD before tax. A year costs the same as ten monthly payments.

Compare all plan features
Can I publish a free website without buying a domain?

A small static site can use Spark and the platform HTTPS address on a host with HTTP routing enabled. Upload the built files to keep compilation out of the free plan’s memory budget.

Where should my contact form or private API key live?

Send the form to a server endpoint, such as a PHP handler or a Node.js or Python application. Read the private key there. Browser bundles and static files are downloadable by anyone who visits the page.

Why do styles disappear after publishing?

Compare the stylesheet URL in the generated HTML with its location inside the public directory. With public/index.html as the index, public/style.css is served at /style.css. Check the path and letter case.

Why does refreshing a frontend route return 404?

For a client-side router on a static site, set STATIC_SPA=1 and restart. Test a direct visit to the nested URL as well as navigating there from the home page.

Can I restore the previous version?

For Static site and Built frontend, use the previous published release in Deploy. The release switch changes the files served to visitors while keeping your current working files. For PHP, Node.js or Python, redeploy the known-good source.