Git is a distributed version control system that helps developers track changes in their code.
It enables automated deployments and efficient management of different versions of a project.
Using Git for version control in RunCloud is an excellent way to manage web application deployments efficiently.
RunCloud-managed servers typically come with Git pre-installed. We can set up Git while configuring web applications directly from the interface.
In order to set up a web application using Git, please follow the steps given below:
-Go to your RunCloud dashboard and click on ‘Create a Web Application’, then click on the ‘Git Repository”’ tab.
-Select your Git hosting service. Then, enter the name of your web application and select the system user. We suggest that you create a new system user for each web application for better security.
-Then, you will be asked to enter your webapp domain and SSL. Enter the domain name or select ‘test domain’ and proceed.
-Enter the repository name and the branch that you would like to deploy.
Please ensure that you are not using any of the following characters as you may receive the error ‘Invalid repository name’
[<>:”/|?’!@#$%^&()_+-~`,]
In order to give your RunCloud server access to your files, you will need to configure a Deployment key by following the steps below:
-In the RunCloud dashboard, select the server where you want to deploy your web application.
-Click on ‘Deployment Key’, then click the ‘View’ button next to the system user account you want to use. If no deployment key exists, generate a new one.
-Copy the generated SSH key, then log in to your Git provider’s dashboard and navigate to the repository settings of the project you want to deploy.
-Under the ‘Deploy Keys’ section, click ‘Add Deploy Key’.
-Enter a title for your Deploy Key and paste the SSH key generated from RunCloud.
-Save the key in your Git provider’s dashboard.
Your web application is now successfully connected to your Git repository using a Deployment Key, allowing you to proceed with deployment.
Once all details are added, click ‘Deploy’ to save the changes. This will clone your web repository and deploy it to the specified domain. If your application requires additional services, such as a database, you can configure them now.
You can also obtain the WebHook URL from RunCloud, enabling you to trigger a deployment whenever you push new changes to your repository branch. Simply add this WebHook URL to your repository settings within your Git provider’s dashboard.
Navigate to WebApp > Git Deployment, then click on ‘Git’ > ‘Webhook URL’ (selected by default). Copy the provided WebHook URL and add it to Settings > Webhooks in your Git provider’s dashboard. On the next screen, paste the URL, set the content type to ‘application/json’, and leave the remaining settings as default. Click ‘Add Webhook’ to save your changes.
Once a change is made in your Git repository, you can view recent events under ‘Webhook History’ in the WebApp.
RunCloud supports automatic deployments and versioning using webhooks.
If you have any difficulty setting up the RunCloud server or using Git for version control in RunCloud, we are here to assist you with the setup. Let us know how we can help!

