Skip to main content

Static Deployments

Static Deployments allow you to deploy static websites and frontend applications on Replit. If you don't need a backend server or can statically build your website using your frontend framework, Static Deployments allow you to deploy your website in a cost-effective manner versus deploying a Reserved VM or an Autoscale Deployment.

Setting up your Repl

Before using a Static Deployment, you should verify that your Repl is working. You can do so using the "Run" button at the top of the workspace.

running your Repl

Next, ensure that your Repl can build your website into static files and take note of the directory. For example, if you are using Vite, you can run npm run build or npx vite build in the workspace's shell tool to initiate the build process. Once that is complete, you should see a dist directory in your Repl's file tree (or whichever output directory your framework uses).

npm run build dist directory

Creating a Deployment

First, open up the Deployments tab. You can do this by clicking the "Deploy" button at the top right of the workspace or opening a new pane and typing "Deployments".

opening the Deployments tab

In the Deployments tool, select the "Static" Deployment type, then proceed using the "Set up your deployment" button.

Deployments tab

Configuring your Deployment

Configure the build command and public directory that you noted earlier. The build command is run when your Deployment is created, and the public directory is the directory to which your static files are built.

configuring your Deployment

Note: If you want to host all files within your Repl, use ./ as the public directory.

Starting your Deployment

After configuring your Deployment, click "Deploy" to start the deployment process. Once the Deployment is complete, you can access details like the URL, build logs, and more. Learn more about managing your Deployment here.

initiate the deployment process deployment complete

Billing

Static deployments are free to create for users with a Hacker or Pro subscription. Those users receive up to 100 static deployments. Please contact us if you need more.

You will be billed for egress once you’ve exceeded your monthly allowance. Learn more about usage-based billing [here](TODO: Link here).