This tutorial will show how to run Gradle Enterprise on the Google Cloud Platform.
You can complete this tutorial in:
10 minutes (read the tutorial)
30 minutes (read the tutorial and perform the installation)
Gradle Enterprise can be installed on most modern Linux servers. The majority of this tutorial is a quick start guide to creating and minimally configuring an instance in GCP for a Gradle Enterprise installation. If you already have GCP expertise and are able to provision an instance, you may wish to skip straight to the Gradle Enterprise installation instructions.
You can create a free account if you do not already have one.
You can request a Gradle Enterprise trial here. If you have purchased Gradle Enterprise, you will already have a license file.
You will be using the
gcloud command line tool to provision and configure our server. To install on your local machine, there are instructions in the Google Cloud documentation.
Google Cloud Platform machines are provisioned with an external IP address but no hostname. If you want to access Gradle Enterprise by a host name of your choosing (e.g.
gradle.mycompany.com), you will need the ability to create the necessary DNS record to route this name to the instance IP address.
You are able to easily update this later. You can start with the raw IP address, and later reconfigure to use a custom hostname if desired.
Your Gradle Enterprise instance will be accessible via the public Internet. By default, all communication with Gradle Enterprise is encrypted over HTTPS, either via self-signed certificate or a certificate issued to you by a trusted certificate authority. Once Gradle Enterprise is installed, you may switch off HTTPS via the Gradle Enterprise Admin Console if you prefer.
Using a self-signed certificate will require some extra configuration for the users of your Gradle Enterprise installation, but will also result in traffic being encrypted.
In this section you will create a Google Cloud Platform instance to run Gradle Enterprise.
First, you need to log in to GCP by entering the command:
$ gcloud auth login
This will open a browser window and let you select the registered user to use. Once this is done, the following output will be displayed in the terminal window.
You are now logged in as [email@example.com].
Machines on the Google Cloud Platform are organized into projects which have to have a globally unique ID between 6 and 30 characters in length (lowercase letters, digits or hyphens and starting with a letter).
| If you already have a project you want to use, you can skip creating a new one and just issue the command
Once you’ve decided on your
«unique-project-id», you can issue the command:
$ gcloud projects create «unique-project-id»
After your project is created, you will need to enable billing via the UI by visiting this page, clicking “Select” to choose your freshly created Project, and then clicking “Link a billing account”.
You can then set this as the default project for
gcloud by entering:
$ gcloud config set project «unique-project-id»
Looking at the requirements in the Gradle Enterprise Admin Manual, let’s create an instance with 250GB of storage, 4 CPUs and 8GB of RAM.
If you do not have a preferred operating system,
gcloud will use
debian-9 as a base operating system. The list of supported operating systems supported by Gradle Enterprise can be found here.
For this tutorial, let’s name the instance
gradle-enterprise and define our settings by entering the following command in the terminal:
$ gcloud compute instances create gradle-enterprise --custom-cpu=4 --custom-memory=8GB --boot-disk-size=250GB
| If you have a preferred supported operating system, you can pass it as a parameter to the
You will be asked if you want to enable the “compute.googleapis.com” for your project. Choose “Yes” to continue.
Then you will be asked to select a geographical zone to launch the instance in
For the following instance: - [gradle-enterprise] choose a zone:  asia-east1-a  asia-east1-b  asia-east1-c  asia-northeast1-a  asia-northeast1-b  asia-northeast1-c  asia-south1-a  asia-south1-b  asia-south1-c  asia-southeast1-a  asia-southeast1-b  australia-southeast1-a  australia-southeast1-b  australia-southeast1-c  europe-west1-b ...snip...  us-east4-b  us-east4-c  us-west1-a  us-west1-b  us-west1-c Please enter your numeric choice:
You should generally pick the zone closest to you geographically to ensure the best performance, by entering the number next to the zone of choice.
The instance will then be created and in the output, you can see the “EXTERNAL_IP” of the instance
Created [https://www.googleapis.com/compute/v1/projects/gradle-enterprise-tutorial/zones/europe-west1-b/instances/gradle-enterprise]. NAME ZONE MACHINE_TYPE PREEMPTIBLE INTERNAL_IP EXTERNAL_IP STATUS gradle-enterprise europe-west1-b custom (4 vCPU, 8.00 GiB) 10.132.0.2 184.108.40.206 RUNNING
On the Google Compute Platform, firewall rules are set at project level. There are some ports you will need to expose to access Gradle Enterprise. These are:
Port 80 for HTTP
Port 443 for HTTPS
Port 8800 for the Gradle Enterprise admin console
This can be done via the following three commands:
$ gcloud compute firewall-rules create ge-http --allow tcp:80 --description="GE HTTP" $ gcloud compute firewall-rules create ge-https --allow tcp:443 --description="GE HTTPS" $ gcloud compute firewall-rules create ge-console --allow tcp:8800 --description="GE Admin Console"
You can check these have been set correctly by the command:
$ gcloud compute firewall-rules list NAME NETWORK DIRECTION PRIORITY ALLOW DENY default-allow-icmp default INGRESS 65534 icmp default-allow-internal default INGRESS 65534 tcp:0-65535,udp:0-65535,icmp default-allow-rdp default INGRESS 65534 tcp:3389 default-allow-ssh default INGRESS 65534 tcp:22 ge-http default INGRESS 1000 tcp:80 ge-https default INGRESS 1000 tcp:443 ge-console default INGRESS 1000 tcp:8800
If you intend to use a custom hostname to access your Gradle Enterprise instance, you now need to add the appropriate DNS records.
A record for your hostname that points to the “External IP” address of your instance which you saw at the end of step 3 of this tutorial.
gradle-enterprise.company.com A 220.127.116.11
Alternatively, you can just use the “External IP” address in the following steps.
Whichever you choose, for the rest of the tutorial, this will be referred to as the
In this section you will install Gradle Enterprise on your newly created instance.
SSH into your instance with the following command:
$ gcloud compute ssh gradle-enterprise
This will ask you for a passphrase (which you will need to remember for next time you want to access the instance) and generate an SSH key. It will then ask you for the passphrase again, and if successful will give you command line access to the machine.
Once you’re on the machine, start the installation by issuing the command:
$ curl -sSL https://get.replicated.com/docker/gradleenterprise/stable | sudo bash
The installer will ask if you require a proxy to access the internet. Choose “No” to continue.
Once that has finished installing, open a web browser and navigate to
https://«instance-address»:8800 to access the admin console (you will need to accept the warning in your browser due to there not being a valid SSL certificate).
«instance-address» into the hostname field.
If you have a trusted SSL certificate for your hostname, you can upload it here. Otherwise, click “Use Self-Signed Cert”.
The system will then perform some pre-flight checks, after which you can select “Continue”, and then select “Dashboard” from the navigation menu at the top of the page.
The latest version of Gradle Enterprise will begin downloading and will start automatically.
Once the dashboard shows “Started” in the left-hand panel, you can access Gradle Enterprise by either clicking “Open”, or by navigating to
Please consult the Getting Started with Gradle Enterprise guide for how to configure your Gradle builds to leverage your new Gradle Enterprise installation.
When you wish to shut down your instance, you simply need to enter the command
$ gcloud compute instances delete gradle-enterprise
This will inform you that the instance and attached storage will be destroyed, and ask if you are sure. Choose “Yes” to continue.
If you also want to remove the project you created in step 2 then you can run the command
$ gcloud projects delete «unique-project-id»
And again, choose “Yes” to continue.