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 Replit App from GitHub
- Navigate to https://replit.com/new or click the ”+” button at the top right of the screen to create a new Replit App.
- Click the “Import from GitHub” button at the top right of the modal.
- Enter the URL or the name of the GitHub repository you want to import. You do not need to be the repository owner.
Configure the Replit App
- After importing, configure the run command for the Replit App. This is usually auto-filled, but you can modify it to suit your project’s requirements.
- Click the “Run” button at the top right of the screen to ensure the Replit App can run.
- The Replit App will install packages and execute the run command.
Modify the Run command
If you need to change the run command:
- Click the “Show hidden files” button at the top right of the file tree and open the
.replit
file.
-
In the
.replit
file, change therun
line to:
- Rerun the Replit App to ensure it works as expected. Once confirmed, proceed to deploy the Replit App.
Deploying the Replit App
- Click the “Release” button at the top right of the screen.
-
Select the “Deploy” option, allowing you to deploy the Replit App to a public
<app-name>.replit.app
URL (or a custom domain) for public hosting. -
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. :::
-
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.
- Enter the build command, run command, and any environment variables needed for production.
:::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). :::
- Once you have entered the required information, click the “Deploy” button to initiate the Deployment process.
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 page helpful?