JetBrains Upsource: installation, configuration on Linux with NGINX and SSL and PyCharm integration

By | 04/02/2019

Upsource is a self-hosted service from JetBrains for code reviews by teams of developers which can be integrated with any IDE from JetBrains.

Is a Java-based application with Apache Cassandra as a backend for storing data and indexes.

Minima requirements – 8 GiB memory on a host – not surprise at all.

Up to 10 users is free for usage.

In this post – an installation and configuration example on an AWS EC2 instance and connection from PyCharm.

In front of Upsource will have NGINX with SSL from Let’s Encrypt.

NGINX and Let’s Encrypt client is already installed – check the TestRail: QA Test Case Management installation on Linux post for details.

Documentation is here>>>.

Installing Upsource

Create a new user:

root@bttrm-testrail:/home/admin# useradd -r upsource

Create a working directory:

root@bttrm-testrail:/var/www# mkdir

Download an archive from the downloads page, unpack it:

root@bttrm-testrail:/var/www# wget
root@bttrm-testrail:/var/www# unzip

Move content to the working directory:

root@bttrm-testrail:/var/www# mv upsource-2018.2.1154/*
root@bttrm-testrail:/var/www# cd

Launch scripts located at the bin/ catalog:

root@bttrm-testrail:/var/www/ ll bin/
total 8
-rw-r--r-- 1 root root 3458 Dec 31 16:06 upsource.bat
-rwxr-xr-x 1 root root 2981 Dec 31 16:06

Install Java:

root@bttrm-testrail:/var/www/ apt install default-jdk
root@bttrm-testrail:/var/www/ java -version
openjdk version "1.8.0_212"

Launch Upsource.

Use run command for tests-debug and start to run the application in the background. Other commands can be found with help:

root@bttrm-testrail:/var/www/ ./bin/ help
/bin/sh /var/www/ <command>
<command> can be one of the following:
configures Upsource, call "help configure" for details
starts Upsource in background, call "help start" for details

For now – run with the run:

root@bttrm-testrail:/var/www/ ./bin/ run
Starting Upsource...
* Configuring JetBrains Upsource 2018.2
command [hostname]: hostname: Name or service not known
* Made default base-url '' from hostname '' and listen port '8080'
* JetBrains Upsource 2018.2 runtime environment is successfully configured
* Loading logging configuration from /var/www/
* Redirecting JetBrains Upsource 2018.2 logging to /var/www/
* Configuring Service-Container[bundleProcess]
* Configuring Bundle Backend Service
* Configuring Configuration Wizard
command [hostname]: hostname: Name or service not known
* Starting Service-Container[bundleProcess]
* Starting Bundle Backend Service
* Starting Configuration Wizard
* JetBrains Upsource 2018.2 Configuration Wizard will be available on [] after start

Looks like works – go to SSL.

Let’s Encrypt

Obtain a new certificate via standalone authenticator as there is no NGINX config for a new virtual host yet:

root@bttrm-testrail:/var/www/ systemctl stop nginx
root@bttrm-testrail:/var/www/ /opt/letsencrypt/letsencrypt-auto certonly -d
Saving debug log to /var/log/letsencrypt/letsencrypt.log
How would you like to authenticate with the ACME CA?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: Nginx Web Server plugin (nginx)
2: Spin up a temporary webserver (standalone)
3: Place files in webroot directory (webroot)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate number [1-3] then [enter] (press 'c' to cancel): 2
Plugins selected: Authenticator standalone, Installer None
- Congratulations! Your certificate and chain have been saved at:
Your key file has been saved at:


Create the virtual host config, documentation is here>>>:

server {

    listen 80;

    # Lets Encrypt Webroot
    location ~ /.well-known {

    root /var/www/html;
        allow all;

    location / {

        # office1
        allow 194.***.***.24/29;
        # office2
        allow 91.***.***.78/32;
        # arseny home
        allow 188.***.***.48/32;
        # unknown
        #allow 93.***.***.125/32;
        deny  all;

        return 301;

server {

    listen       443 ssl;

    root /var/www/;

    access_log  /var/log/nginx/;
    error_log /var/log/nginx/ warn;

    # office1
    allow 194.***.***.24/29;
    # office2
    allow 91.***.***.78/32;
    # arseny home
    allow 188.***.***.48/32;
    deny  all;

    ssl_certificate /etc/letsencrypt/live/;
    ssl_certificate_key /etc/letsencrypt/live/;

    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_prefer_server_ciphers on;
    ssl_dhparam /etc/nginx/dhparams.pem;
    ssl_session_timeout 1d;
    ssl_stapling on;
    ssl_stapling_verify on;

    location / {
        proxy_set_header X-Forwarded-Host $http_host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_http_version 1.1;

        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_pass http://localhost:8080;
        proxy_pass_header Sec-Websocket-Extensions;

Check and reload NGINX’s configs:

root@bttrm-testrail:/var/www/ nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
root@bttrm-testrail:/var/www/ service nginx reload

Starting Upsource

Update /etc/security/limits.conf.

The documentation says to set limits for all users – but IMHO, not the best idea, so set it only for our user:

upsource        -       memlock         unlimited
upsource        -       nofile          100000
upsource        -       nproc           32768
upsource        -       as              unlimited

Update the /etc/hosts file – it must have $HOSTNAME name added – otherwise, Apache Cassandra will not run.

Check the name:

root@bttrm-testrail:/var/www/ hostnamectl
Static hostname: bttrm-testrail

Add it:

... localhost bttrm-testrail

Change directory and files owner:

root@bttrm-testrail:/var/www/ chown -R upsource:upsource /var/www/

Switch to the upsource user:

Run using the start command:

root@bttrm-testrail:/var/www/ su -l upsource
upsource@bttrm-testrail:~$ cd /var/www/
upsource@bttrm-testrail:/var/www/$ ./bin/ start
Starting Upsource...
* Configuring JetBrains Upsource 2018.2
* JetBrains Upsource 2018.2 runtime environment is successfully configured
* Loading logging configuration from /var/www/
* Redirecting JetBrains Upsource 2018.2 logging to /var/www/
* Configuring Service-Container[bundleProcess]
* Configuring Bundle Backend Service
* Configuring Starting Page Service
* Configuring Upsource Configurator
* Configuring Hub
* Configuring Bundle Hub Configurator
* Configuring Apache Cassandra
* Configuring Upsource Cluster Initialize Service
* Configuring Upsource Frontend
* Starting Service-Container[bundleProcess]
* Starting Bundle Backend Service
* Starting Starting Page Service
* JetBrains Upsource 2018.2 will be available on [] after start
* Starting Upsource Configurator
Upsource is running

On the first start, Upsource will generate an authorization token and will save it to the  /var/www/ file.

systemd unit

To magae Upsource as a system service – create a /etc/systemd/system/upsource.service file:

Description=JetBrains Upsource

ExecStart=/var/www/ start
ExecStop=/var/www/ stop
ExecReload=/var/www/ restart


Stop Upsource started manually:

upsource@bttrm-testrail:/var/www/$ ./bin/ stop

And run via systemd:

root@bttrm-testrail:/etc/nginx/conf.d# systemctl start upsource.service
root@bttrm-testrail:/etc/nginx/conf.d# systemctl status upsource.service
● upsource.service - Upsource Code Review service
Loaded: loaded (/etc/systemd/system/upsource.service; disabled; vendor preset: enabled)
Active: active (running) since Tue 2019-04-02 10:23:43 UTC; 2s ago
Main PID: 5356 (bash)
Tasks: 53 (limit: 4915)
CGroup: /system.slice/upsource.service
├─5356 /bin/bash start
Apr 02 10:23:43 bttrm-testrail systemd[1]: Started Upsource Code Review service.
Apr 02 10:23:44 bttrm-testrail bash[5356]: Starting Upsource...

Add to auto-launch:

root@bttrm-testrail:/etc/nginx/conf.d# systemctl enable upsource.service
Created symlink /etc/systemd/system/ → /etc/systemd/system/upsource.service.

Upsource configuration

Go to the and make initial configuration:

Insert token from the wizard_token.txt, press Log in, click on the Set up:

You can leave everything with default values here – Upsource will set its URL here itself.

Also, leave HTTP here as between NGINX and Upsource we have HTTP and SSL will be terminated on the NGINX:

Add admin user:

And leave others with defaults too:

Wait for Upsource to be fully started:

If any – check logs in the /var/www/

Wait 1-2 minute:

PyCharm integration

In your PyCharm go to the Settings > Plugins, find and install Upsource Integration:

Click on the Test Connection – you’ll be redirected to your default browser for authorization: