Production Install - Azure


All shell commands are run as root.

  1. Create an instance for the Scalr App Server.

    • A single server with minimum 4CPU x 16GB RAM and 50GB storage mounted on /opt/scalr-server/

    • OS: Ubuntu 18.04, RHEL/CentOS 8.x, or Amazon Linux 2

  1. On the Scalr App Server, get the scalr-server package and install it:

    # For Debian:
    curl -s https://<token> | sudo bash
    apt-get install scalr-server
    # For RPM:
    curl -s https://<token> | sudo bash
    yum install scalr-server
  2. On the Scalr App Server, run the following when prompted:


    This command creates the /etc/scalr-server directory and the scalr-server-secrets.json file.

  3. Create an Azure Database for MySQL.

    MySQL > 5.7.8 database instance with 4CPU x 16GB RAM and 500GB storage. MySQL 8.0 is not supported yet. SSL connection should not be enforced.

    1. Set the root user with the password that is copied from /etc/scalr-server/scalr-server-secrets.json file.

    2. Set the following MySQL server system variables.

      • Set the max_allowed_packet to 268435456 (256M)


      • Set the init_connect to SET NAMES utf8mb4 (use utf8mb4 if Scalr ≥ 8.37.0 or utf8 otherwise)

      • Set the log_bin_trust_function_creators to 1 (On)

    3. Create the databases and users on the database instance by running the following SQL:

      -- use utf8mb4 if Scalr ≥ 8.37.0 or utf8 otherwise
      CREATE DATABASE scalr CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
      CREATE USER 'scalr'@'%' IDENTIFIED BY '<copy scalr password from scalr-server-secrets.json>';
      GRANT ALL PRIVILEGES ON scalr.* TO 'scalr'@'%';
  1. On the Scalr App Server create/copy the following:

    1. Your Scalr license file to /etc/scalr-server/license.json.

    2. Your SSL Cert to a suitable location, e.g. /etc/scalr-server/organization.crt

    3. Your SSL key to a suitable location, e.g. /etc/scalr-server/organization.key

  2. On the Scalr App Server, edit the Scalr configuration file /etc/scalr-server/scalr-server.rb to match your set up. This example can be pasted to the file and edited. Make sure to update the values with the actual values for you installation. You will need to check and/or update the following:

    • proxy[:ssl_cert_path]

    • proxy[:ssl_key_path]

    • routing[:endpoint_host]

    • app[:mysql_scalr_host]

      enable_all true
      product_mode :iacp
      mysql[:enable] = false
      # Mandatory SSL
      # Update the below settings to match your FQDN and where your .key and .crt are stored
      proxy[:ssl_enable] = true
      proxy[:ssl_redirect] = true
      proxy[:ssl_cert_path] = "/etc/scalr-server/organization.crt"
      proxy[:ssl_key_path] = "/etc/scalr-server/organization.key"
      routing[:endpoint_host] = ""
      routing[:endpoint_scheme] = "https"
      #Enter the IP or domain name of your MySQL instance
      app[:mysql_scalr_host] = MYSQL_SERVER_HOST
      app[:mysql_scalr_port] = 3306
      #Add if you have a self signed cert, update with the proper location if needed
      #ssl[:extra_ca_file] = "/etc/scalr-server/rootCA.pem"
      #Add if you require a proxy, it will be used for http and https requests
      #http_proxy "http://user:*****"
      #If a no proxy setting is needed, you can define a domain or subdomain like so: no_proxy="," . The following setting would not work: *,*
      #no_proxy ""
      ####The following is only used for optional configuration as needed.####
      #app[:configuration] = {
      #:scalr => {
      #  "tf_worker" => {
      #      "runner" => {
      #            "run_time_limit": 720  # 12h #Default is 60/1hr,
      #           "docker" => {
      #              "device_read_iops" => 500, #Limit read rate (IO per second) from the device(s). This option will only work in conjunction with `tf_worker.runner.docker.storage_devices` option. Disabled by default.
      #              "device_write_iops" => 500, #Limit write rate (IO per second) from the device(s). This option will only work in conjunction with `tf_worker.runner.docker.storage_devices` option. Disabled by default.
      #              "storage_devices" => ["/dev/sda"], #The list of block devices for the `device_read_iops` and `device_write_iops` options. The device(s) must exist on the Docker node. Usually, there should be one device on which the `/opt/scalr-server/` directory is mounted, unless you are using custom docker daemon with non-default configuration. Warn: The non-existent device in this list will break the Terraform Runs. Default is [].
      #              "mem_limit" => 256, #Memory limit in megabytes. Optional, default value: 256 (mb).
      #              "cpu_period" => 100000, #Limit CPU CFS (Completely Fair Scheduler) period (in microseconds). Optional, default value: 100000 (μs).
      #              "cpu_quota" => 50000 #CPU time that the container can get in a CPU period (in microseconds). Optional, default value: 50000 (μs).
      #           }
      #       }
      #    }
      #  }
  3. Set the correct MySQL username by specifying mysql[:scalr_user] = 'scalr@%host%' in the /etc/scalr-server/scalr-server.rb configuration file. The %host% here must be replaced with the name of your database server in Azure. If your database name is my-test the scalr username should be scalr@my-test.

  4. On the Scalr App Server, reconfigure Scalr:

    /opt/scalr-server/bin/scalr-server-ctl reconfigure

You can now log into Scalr by putting the hostname that is listed as your endpoint in the scalr-server.rb into a browser. To log in the first time, please find the admin password in the /etc/scalr-server/scalr-server-secrets.json file. The username is admin.

"app": {
  "admin_password": "password123"