Deploying Jira on Google Cloud

This tutorial shows how to deploy Atlassian Jira Server Edition on Google Cloud, using Compute Engine and using Cloud SQL as the MySQL database.


  • Create a Linux Ubuntu virtual machine to install Jira version 8.8.1.
  • Create a Cloud SQL for MySQL version 5.7 instance for Jira to connect to.
  • Configure Jira to run as a service.
  • Enable access to the Jira service using HTTPS.


This tutorial uses billable components of Google Cloud, including:

  • Compute Engine
  • Cloud SQL
  • Cloud Load Balancing
  • Networking

Use the Pricing Calculator to generate a cost estimate based on your projected usage.

Before you begin

  1. Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
  2. In the Google Cloud Console, on the project selector page, select or create a Google Cloud project.

    Go to project selector

  3. Make sure that billing is enabled for your Cloud project. Learn how to confirm that billing is enabled for your project.

  4. Enable the Compute Engine and Cloud SQL Admin APIs.

    Enable the APIs

In addition, make sure you meet these requirements:

  • Make sure you have a trial or full license key for Jira Server Edition.
  • Make sure you have a domain name registered for your Jira site.

When you finish this tutorial, you can avoid continued billing by deleting the resources you created. See Cleaning up for more detail.

Deployment architecture

The following diagram shows the deployment architecture you use to install Jira. The primary Jira application server runs on a Compute Engine instance. That instance is securely connected to an instance of Cloud SQL for MySQL using the Cloud SQL Proxy tool running on the same virtual machine as Jira.

Architecture of JIRA deployment on Google Cloud

Setting up your environment

In this section, you configure the infrastructure and identities that are required in order to complete the tutorial.

Start a Cloud Shell instance

You run all the terminal commands in this tutorial from Cloud Shell.

Configure a service account

The next step is to create a service account to delegate permissions to Jira so that Jira can access data in Cloud SQL.

  1. In Cloud Shell, create the service account:

    gcloud iam service-accounts create jira-service-account \
        --display-name jira-service-account
  2. Store the service account email address, current project ID, and default zone in environment variables for use in later commands. For [ZONE], choose the zone that's geographically closest to you.

    export SA_EMAIL=$(gcloud iam service-accounts list \
        --filter="displayName:jira-service-account" \
    export PROJECT=$(gcloud info \
    export ZONE=[ZONE]

    To see a list of zones, run the following command:

    gcloud compute zones list
  3. Bind the roles/cloudsql.client role to your service account:

    gcloud projects add-iam-policy-binding $PROJECT \
        --role roles/cloudsql.client \
        --member serviceAccount:$SA_EMAIL

Creating an instance of Cloud SQL for MySQL

For this tutorial, you set up Jira to use a MySQL database. Rather than installing MySQL yourself, you use Cloud SQL, which provides a managed version of MySQL.

  1. In Cloud Shell, create an instance of Cloud SQL with MySQL as the database. The following command uses the name mysql-jira-instance as the name of the instance. You can use a different name; if you do, make a note of it, because you need this name in later steps.

    gcloud sql instances create mysql-jira-instance \
        --database-version MYSQL_5_7 --zone $ZONE \
        --database-flags \

    The properties of the new instance are displayed:

    NAME                 DATABASE_VERSION  LOCATION    TIER              STATUS
    mysql-jira-instance  MYSQL_5_7         us-east1-d  db-n1-standard-1  RUNNABLE
  2. Set the password for the root@% MySQL user. If you didn't use the name mysql-jira-instance for the Cloud SQL instance, be sure that you use the name you used earlier. For [PASSWORD], substitute a strong password.

    gcloud sql users set-password root \
        --host=% --instance=mysql-jira-instance --password=[PASSWORD]

Creating the Compute Engine instance and instance group

You create a Compute Engine instance to deploy Jira and then add the new instance to an instance group. This allows you to use an HTTPS load balancer in a later step.

Create the Compute Engine instance

For this tutorial, you use the default machine type of n1-standard-1.

  • In Cloud Shell, create a Compute Engine instance on which you can install Jira Software. For this tutorial, you name the instance jira-instance.

    gcloud config set compute/zone $ZONE
    gcloud compute instances create jira-instance \
        --image-family ubuntu-1804-lts \
        --image-project gce-uefi-images \
        --tags=jira-server \
        --service-account $SA_EMAIL \
        --scopes cloud-platform

    The properties of the new instance are displayed:

    jira-instance  us-east1-d  n1-standard-1                 RUNNING

For more information about operating systems and machine types by Jira, see the following Atlassian pages:

Create an instance group and add the Compute Engine instance

You can now create an instance group and add the jira-instance virtual machine.

  1. In Cloud Shell, create an instance group:

    gcloud compute instance-groups unmanaged create jira-resources \
        --zone $ZONE
  2. Add the Compute Engine instance to the instance group:

    gcloud compute instance-groups unmanaged add-instances jira-resources \
        --instances jira-instance \
        --zone $ZONE

Installing Jira Software

In this section, you configure the Compute Engine instance and complete the Jira installation.

Connect to the Compute Engine instance

In order to configure the instance settings, you establish an SSH connection to your instance.

  • In Cloud Shell, connect to your instance:

    gcloud compute ssh jira-instance

    Compute Engine generates an SSH key and adds the generated key to the project or instance metadata.

Install required packages

In the Compute Engine instance, you need to install tools that let you work with Jira and with MySQL in later steps.

  1. At the command line of your instance, install wget:

    sudo apt-get install wget
  2. Install the MySQL client on the instance:

    sudo apt-get install mysql-client

Download the software installer and install Jira Software

  1. At the command line of your instance, download the Jira Software installer from Atlassian:

  2. Make the installer file executable:

    chmod a+x atlassian-jira-software-8.8.1-x64.bin
  3. Run the installer. You must perform this step using sudo, which gives you the option to install Jira as a service during the installation process.

    sudo ./atlassian-jira-software-8.8.1-x64.bin

    If prompted, install any dependencies.

  4. Enter the following values during the installation process:

    • Installation option: choose Custom Install (option 2)
    • Installation directory: /opt/atlassian/jira
    • Software data directory: /var/atlassian/application-data/jira
    • TCP ports: HTTP: 8080, Control: 8005
    • Install as service: y
    • Start Jira: no. You don't want to start Jira yet, because there are steps remaining.
  5. Clean up by removing the installer file:

    rm atlassian-jira-software-8.8.1-x64.bin

Configuring a connection for Jira to Cloud SQL for MySQL

This section describes how to use the MySQL client to connect to Cloud SQL for MySQL, the database used by Jira.

Download MySQL Connector/J

Jira connects to a database using a JDBC database connection. The MySQL Connector is the official JDBC driver for MySQL. This tutorial uses version 5.1.48 of the MySQL Connector.

  1. At the command line of your Jira instance, download the connector:

  2. Uncompress the tar file:

    tar -xzf mysql-connector-java-5.1.48.tar.gz
  3. Copy the file to /opt/atlassian/jira/lib:

    sudo cp ./mysql-connector-java-5.1.48/mysql-connector-java-5.1.48-bin.jar /opt/atlassian/jira/lib/.
  4. Clean up by removing the tar file:

    rm -rf mysql-connector-java-5.1.48d \

Install Cloud SQL Proxy on the Compute Engine instance

Cloud SQL Proxy helps provides secure access to Cloud SQL for the MySQL instance.

  1. At the command line of your instance, download the proxy:

    wget -O cloud_sql_proxy
  2. Make the proxy executable:

    chmod +x cloud_sql_proxy
  3. Copy the proxy binary to a local directory:

    sudo cp cloud_sql_proxy /usr/local/bin/.

Running Jira as a service

Running Jira as a service allows Jira to start automatically whenever the computer restarts.

  1. At the command line of your instance, create a new file called cloud_sql_proxy.service. For example, use the following vi command to create the cloud_sql_proxy.service file:

    sudo vi /lib/systemd/system/cloud_sql_proxy.service
  2. Add the following configuration to the file. Replace [PROJECT_ID] with your Google Cloud project ID, and replace [REGION] with the region you are using (for example, us-east1). If you didn't use the name mysql-jira-instance for the Cloud SQL instance, substitute your name.

    Description=Google Cloud SQL Proxy
    ExecStart=/bin/sh -c '/usr/bin/nohup /usr/local/bin/cloud_sql_proxy -instances=[PROJECT_ID]:[REGION]:mysql-jira-instance=tcp:3306 &'
  3. Save and close the file.

  4. Create a new file called jira.service:

    sudo vi /lib/systemd/system/jira.service
  5. Add the following configuration to the file.

    Description=JIRA Service
    Requires=cloud_sql_proxy.service iptables.service firewalld.service httpd.service
    ExecReload=/opt/atlassian/jira/bin/ | sleep 60 | /opt/atlassian/jira/bin/
  6. Save and close the file.

  7. Remove the SysV script that was created when you installed Jira:

    sudo rm /etc/init.d/jira
  8. Enable the Jira and Cloud SQL Proxy services:

    sudo systemctl daemon-reload
    sudo systemctl enable jira
    sudo systemctl enable cloud_sql_proxy
  9. Start the services:

    sudo systemctl start jira

    You need to start only the Jira service. The proxy service is dependent on the Jira service, and it automatically starts after the Jira service has started.

  10. Check the status of the services:

    sudo systemctl status jira
    sudo systemctl status cloud_sql_proxy

    If the status is green and says active (running), the service is active and running. If the status is inactive, try reloading the services again in a few minutes using sudo systemctl daemon-reload.

Starting the MySQL session

This section shows how to create a MySQL user and password and how to create a MySQL database to connect Jira to during the setup process.

  1. At the command line of your instance, start a MySQL session:

    mysql -u root -p --host -P 3306

    When the session is ready, you see the mysql prompt.

  2. Create the database. Substitute [DATABASE_NAME] for your database name. For information on naming, see MySQL's Database Creation Guide.

  3. Create a non-root user and set the user's password. Replace [USERNAME] for your username and [PASSWORD] with your password.

  4. Grant the user all privileges:

  5. Close the MySQL session:

  6. Close the SSH connection to the instance:


Creating and configuring the HTTPS load balancer

The next step is to create an HTTPS load balancer in order to secure traffic to the Jira instance. At the time of writing, running Jira over HTTPS is outside of the scope of Atlassian support. Therefore, you use an HTTPS load balancer with the Jira instance. For more information on configuring HTTPS, see Running Jira applications over SSL or HTTPS on the Atlassian site.

Create a global static IP address

Global static external IP addresses are the external IP addresses that your customers use to reach the load balancer.

  • In Cloud Shell, create a global static external IP address for your load balancer:

    gcloud compute addresses create lb-ip --global

Configure the load balancing service

The next step is to configure the load balancer.

  1. In Cloud Shell, create a named port:

    gcloud compute instance-groups unmanaged set-named-ports jira-resources \
        --named-ports http:8080 \
        --zone $ZONE

    When the port is configured, the load balancing service forwards traffic to the named port.

  2. Create a health check:

    gcloud compute health-checks create tcp jira-health --port 8080
  3. Create a backend service using the jira-health health check. The timeout is configured to 300 seconds to allow time for the installation process to complete. This value is changed to 30 seconds after the installation is complete.

    gcloud compute backend-services create jira-app \
        --protocol http \
        --health-checks jira-health \
        --timeout 300 \
  4. Add your instance group as a backend to the backend service:

    gcloud compute backend-services add-backend jira-app \
        --instance-group jira-resources \
        --instance-group-zone $ZONE \
  5. Create a default URL map that directs all incoming requests to your instances:

    gcloud compute url-maps create jira-app \
        --default-service jira-app

Create a firewall rule

To allow traffic for working with the Jira service, you configure the firewall.

  • Create a firewall rule to allow traffic from the load balancer to the jira-instance instance:

    gcloud compute firewall-rules create jira-lb-allow \
        --action=ALLOW \
        --rules=tcp:8080 \
        --source-ranges=, \

Create a Google-managed SSL certificate resource

To support HTTPS traffic, you need an SSL certificate. In this section, you add a Google-managed SSL certificate. (This feature is currently in beta.) If you want to use a different SSL certificate, see create SSL certificate resource.

Google-managed SSL certificates are automatically renewed in advance of their expiration date. For more information on the renewal process, see Google-managed SSL certificate resource status.

  • In Cloud Shell, create a Google-managed SSL certificate resource. Replace [DOMAIN] with your domain:

    gcloud beta compute ssl-certificates create jira-cert \
        --domains [DOMAIN]

Configure HTTPS routing

You can now configure routing to send Jira traffic to the proxy.

  1. Create a target HTTPS proxy to route requests to your URL map:

    gcloud compute target-https-proxies create https-lb-proxy \
        --url-map jira-app --ssl-certificates jira-cert
  2. Get the static external IP address of the load balancer:

    gcloud compute addresses list

    Make a note of the address because you need it in later steps.

  3. Create a global forwarding rule to route incoming requests to the proxy. Replace [LB_IP_ADDRESS] with the static external address you created and that you listed in the previous step.

    gcloud compute forwarding-rules create https-fwd-rule \
        --address [LB_IP_ADDRESS] \
        --global \
        --target-https-proxy https-lb-proxy \
        --ports 443

Add or update the DNS record

The next step is to add or update the DNS record for your domain so that traffic is directed from your domain to the load balancer.

  1. At your registrar's site, add or update the DNS record for your domain so that it points to the static external IP address you created.

    To see the external IP address, use the following command:

    gcloud compute addresses list

Confirm that the SSL certificate resource is active

The certificate resource provisioning takes several minutes.

  • Check the status of the process:

    gcloud beta compute ssl-certificates list

    Wait for the SSL resource to have an ACTIVE status.

Connecting to Jira in the browser

Now that you have installed Jira, configured it to run as a service, and created a database for it, you can begin the setup process in a web browser window.

  1. On your local computer, open a window in your web browser.
  2. In the address bar, enter: https://[DOMAIN]. Replace [DOMAIN] with your domain.
  3. In the Jira setup window, click I'll set it up myself and then click Next.

    The database connection window appears.

  4. Click my own database, which is recommended for production environments, and fill out the following:

    • Database type: MySQL 5.7+
    • Hostname:
    • Port: 3306
    • Database: the MySQL database you created
    • User: the MySQL user you created
    • Password: the password for the MySQL user
  5. Click the Test Connection button to test your database connection with Jira.

    The following image shows a successful connection.

    screenshot of the database connection page that shows example input values for the connection and a green message at the top of the page saying "The database connection test was successful."

  6. Enter your license key for Jira.

  7. During the setup process, configure your email notifications and admin access.

You now can use Jira Software on your database connection using Cloud SQL for MySQL.

Update the load balancer timeout

Now that the installation is complete, you set the load balancer timeout back to the default value of 30 seconds.

  • In Cloud Shell, update the timeout for the jira-app backend service:

    gcloud compute backend-services update jira-app --timeout 30 --global

Clean up

To avoid incurring charges to your Google Cloud account for the resources used in this tutorial, either delete the project that contains the resources, or keep the project and delete the individual resources.

Delete the project

  1. In the Cloud Console, go to the Manage resources page.

    Go to Manage resources

  2. In the project list, select the project that you want to delete, and then click Delete.
  3. In the dialog, type the project ID, and then click Shut down to delete the project.

What's next