Skip to main content

Deploying a GitHub repository

If you have a project hosted on GitHub that you want to deploy using Replit, the process is incredibly simple. Just follow these easy steps to import your repository, ensure its smooth operation, and deploy it to a public URL for hosting.

Import a Repl from GitHub

  1. Navigate to https://replit.com/new or click the "+" button at the top right of the screen to create a new Repl.

    new repl button
  2. Click the "Import from GitHub" button at the top right of the modal.

    import from github button
  3. Enter the URL or the name of the GitHub repository you want to import. You do not need to be the repository owner.

    import from github modal

Configure the Repl

  1. After importing, configure the run command for the Repl. This is usually auto-filled, but you can modify it to suit your project's requirements.

    github run command
  2. Click the "Run" button at the top right of the screen to ensure the Repl can run.

    run button
  3. The Repl will install packages and execute the run command.

    install packages

Modify the Run command

If you need to change the run command:

  1. Click the "Show hidden files" button at the top right of the file tree and open the .replit file.

    show hidden files dot replit file
  2. In the .replit file, change the run line to:

    run = "npm run <your run command>"
    new run command
  3. Rerun the Repl to ensure it works as expected. Once confirmed, proceed to deploy the Repl.

    successful run

Deploying the Repl

  1. Click the "Release" button at the top right of the screen.

    release button
  2. Select the "Deploy" option, allowing you to deploy the Repl to a public <app-name>.replit.app URL (or a custom domain) for public hosting.

  3. Choose the Deployment tier you want to use. You can use the dropdown to select the perfect power for your Deployment machine. Learn more about the different Deployment tiers here.

    note

    Dedicated machines provide full, unshared CPU power for consistent performance. In contrast, shared machines allocate CPU resources among multiple virtual machines, potentially leading to variable performance based on other users' activities.

  4. Next, you will see a summary of the purchase. This includes the cost of the tier and if auto-refill is enabled. Click the "Deploy your project" button to continue.

    deployment purchase
  5. Enter the build command, run command, and any environment variables needed for production.

    deployment modal
    note

    If "Health check before promoting" is selected, the system verifies that your Deployment opens a port before promoting it. You can deselect this option to bypass the health check for projects that don't require opening a port (e.g., Discord or Slack bots).

  6. Once you have entered the required information, click the "Deploy" button to initiate the Deployment process.

    deployment building deployment done

Monitoring a Deployment

We offer a few ways of interacting and monitoring your Deployments. You can view and change details such as custom domains, build logs, and build history. Find information on editing Deployment details here.

Troubleshooting

If you're having trouble with your Deployment or the Deployment fails, refer to this page for steps to mitigate issues with Deployments.

Was this helpful?