> ## Documentation Index
> Fetch the complete documentation index at: https://docs.replit.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Static Deployments

> Learn how to publish static websites and frontend apps with Static Deployments.

Static Deployments host your Replit App's static files, such as HTML, CSS, and JavaScript
on a cloud server. The server automatically uses caching and scaling strategies to deliver
your content quickly and economically.

Static Deployments are ideal for the following use cases:

* Marketing landing pages
* Portfolio websites
* Product and API documentation sites

<Note>
  Static Deployments are not compatible with Replit Apps created using Agent.
  Agent automatically creates full-stack apps that require a backend server. For
  Agent-generated apps, use one of the following deployment types: - [Autoscale
  Deployment](/cloud-services/deployments/autoscale-deployments) - [Reserved VM
  Deployment](/cloud-services/deployments/reserved-vm-deployments)
</Note>

<Frame>
  <img src="https://mintcdn.com/replit/jSmYU1wBTvl8UMyc/images/deployments/static/static-deployments.jpg?fit=max&auto=format&n=jSmYU1wBTvl8UMyc&q=85&s=6759388105bd6f2801da48eed6ffb83d" alt="screenshot of the Publishing Project Editor tool" width="1920" height="1080" data-path="images/deployments/static/static-deployments.jpg" />
</Frame>

## Features

Static Deployments include the following features:

* **Cost-effective hosting**: Pay only for the amount of data your website serves.
* **HTTP routing options**: Configure response headers, URL rewrites, and redirects.
* **Custom domains**: Configure a custom domain or use a `<app-name>.replit.app` URL to access your app.
* **Custom error pages**: Create and serve a custom 404 error page.
* **Monitoring**: View logs and monitor your published app's status.

## Usage

You can access Static Deployments in the Publishing Project Editor tool.

<Accordion title="How to access Static Deployments">
  From the left **Tool dock**:

  1. Select <img class="icon-svg" src="https://mintcdn.com/replit/X_IP1EeHGm0cA2VA/images/icons/workspace-all-tools-button.svg?fit=max&auto=format&n=X_IP1EeHGm0cA2VA&q=85&s=579643854fb13c402de516695e52c554" alt="All tools icon" width="16" height="16" data-path="images/icons/workspace-all-tools-button.svg" /> **All tools** to see a list of Project Editor tools.
  2. Select <img class="icon-svg" src="https://mintcdn.com/replit/rJldsgYVucXB_6kW/images/icons/deploy-icon.svg?fit=max&auto=format&n=rJldsgYVucXB_6kW&q=85&s=853c5ef39a8a7ac3648b3a2ce182fcb8" alt="Publishing icon" width="16" height="16" data-path="images/icons/deploy-icon.svg" /> **Publishing**.
  3. Select the **Static** option and then select **Set up your published app**.

  From the **Search bar**:

  1. Select the <img class="icon-svg" src="https://mintcdn.com/replit/X_IP1EeHGm0cA2VA/images/icons/workspace-search-icon.svg?fit=max&auto=format&n=X_IP1EeHGm0cA2VA&q=85&s=d3feed840da2d19e1ee4873d137114dc" alt="magnifying glass icon" width="16" height="16" data-path="images/icons/workspace-search-icon.svg" /> magnifying glass at the top to open the search tool
  2. Type "Publishing" to locate the tool and select it from the results.
  3. Select the **Static** option and then select **Set up your published app**.
</Accordion>

<Frame title="Static Deployment configuration screen in the Publishing tool">
  <img src="https://mintcdn.com/replit/jSmYU1wBTvl8UMyc/images/deployments/static/static-deployment-options.png?fit=max&auto=format&n=jSmYU1wBTvl8UMyc&q=85&s=d8cb5b3286737d3c0164a97b7e7793e4" alt="Static Deployment options screen" width="3434" height="1384" data-path="images/deployments/static/static-deployment-options.png" />
</Frame>

### Primary domain

Specify the subdomain part of the hostname for your published app. After you publish, you can access your published app at `https://<subdomain>.replit.app`.

To learn how to use a custom domain, see [Custom Domains](cloud-services/deployments/custom-domains/).

### Private deployment

<Info>
  The private published app feature is available on the Pro and Enterprise plans.
</Info>

Private published apps grant access to your app only to members of your workspace, or to specific users and groups that you invite.
When publishing, you can choose between **Public**, **Workspace only**, or **Only you** access.

To learn how to set up a private deployment, see [Private Deployments](/cloud-services/deployments/private-deployments/).

### Public directory

Specify the base directory path in your Replit App that contains the static files you want to serve publicly.
After you deploy, the cloud host serves all pages and assets in that directory.

The default value, `/`, is the root directory of your Replit App.

### Build command

Specify a build command to run in your Replit App's shell when you create your Deployment.

For example, if you generate a static site using <a href="https://gohugo.io/" target="_blank">Hugo</a>,
you might use the command `hugo --minify` to generate the files and optimize asset file sizes.

### Deployment secrets

Select **Add deployment secret** to add environment variables or secrets your build command needs to run securely.

For example, if your site generator requires an API key to create your static site, you might pass it
`API_KEY=<your secret name>`.

## Next steps

* [Static Deployment Configuration](/cloud-services/deployments/static-deployments-advanced): Configure HTTP headers, a custom 404 page, and URL rewrites
* [Published App Monitoring](/cloud-services/deployments/monitoring-a-deployment): View logs and monitor your published app
* [Publishing costs](/billing/deployment-pricing): View the costs associated with publishing
* [Pricing](https://replit.com/pricing): View the pricing and allowances for each plan type
* [Usage Allowances](/billing/about-usage-based-billing): Learn about scheduled deployment usage limits and billing units
