Install YouTrack on Ubuntu server

JetBrains YouTrack is a project management tool that can be adapted to your processes to help you deliver outstanding products.

This tutorial will show you how to install YouTrack on an Ubuntu 20.04 server with Nginx reverse proxy.

Prerequisites

[1] A server running Ubuntu 20.04 with a minimum 2GB of RAM.

[2] A subdomain pointed to server with SSL configuration.

Getting Started

Download the ZIP distribution, currently the latest version is 2023.1.17582.

wget https://download-cdn.jetbrains.com/charisma/youtrack-2023.1.17582.zip

Unzip the downloaded file.

unzip youtrack-2023.1.17582.zip

Create home directory, e.g.

mkdir /opt/jetbrain

Move unzipped folder to home directory.

mv youtrack-2023.1.17582 /opt/jetbrain

Change the directory to bin folder.

cd /opt/jetbrain/youtrack-2023.1.17582/bin

By default, YouTrack use port 8080, if it was used by another process, you should change to another port. Otherwise, in order to access YouTrack from a subdomain, enter below command.

./youtrack.sh configure --listen-port 1111 --base-url https://youtrack.your-domain.com

Configure Proxy Server

Install Nginx.

apt install nginx

The web server should already be up and running at the end of the installation process. We can check with the systemd init system to make sure the service is running by typing:

systemctl status nginx

Remove default Nginx configuration.

rm -rf /etc/nginx/sites-available/default
rm -rf /etc/nginx/sites-enabled/default

Open the configuration file for your NGINX server. By default, the configuration file is named nginx.conf. The default directory is either /usr/local/nginx/conf, /etc/nginx, or /usr/local/etc/nginx. You can find the exact location of the configuration file by entering nginx -V in a command line interface.

In this tutorial we assume it’s in /etc/nginx directory.

nano /etc/nginx/nginx.conf

Increase the value for the worker_rlimit_nofile directive to a minimum value of 4096.

In the events section, increase the value for the worker_connections directive to a minimum value of 2048.

Create a new configuration file for YouTrack.

nano /etc/nginx/sites-available/youtrack.conf

Add the following configurations.

server {
     listen [::]:80;
     listen 80;

     server_name youtrack.your-domain.com;

     return 301 https://youtrack.your-domain.com$request_uri;
}

server {
    listen 443 ssl http2;

    ssl_certificate /etc/ssl/cert.pem;
    ssl_certificate_key /etc/ssl/key.pem;

    server_name youtrack.your-domain.com;

    add_header Strict-Transport-Security max-age=31536000;

    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_buffers 8 64k;
        proxy_busy_buffers_size 128k;
        proxy_buffer_size 64k;
        client_max_body_size 10m;
        proxy_http_version 1.1;
        proxy_pass http://localhost:1111;
    }
    location /api/eventSourceBus {
        proxy_cache off;
        proxy_buffering off;
        proxy_read_timeout 86400s;
        proxy_send_timeout 86400s;
        proxy_set_header Connection '';
        chunked_transfer_encoding off;
        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_pass http://localhost:1111/api/eventSourceBus;
    }
}

Hit Ctrl+X followed by Y and Enter to save the file and exit.

To enable this newly created website configuration, symlink the file that you just created into the sites-enabled directory.

ln -s /etc/nginx/sites-available/youtrack.conf /etc/nginx/sites-enabled/youtrack.conf

Check your configuration and restart Nginx for the changes to take effect.

nginx -t
service nginx restart

If you get the error:

It means the port has been already in use by another process, run below command to kill.

sudo fuser -k 80/tcp

Restart the nginx

service nginx start

Start the installation (if you do not have a web browser installed on the host machine, follow the command with the --no-browser option).

./youtrack.sh start --no-browser

Access YouTrack Web UI

Access the base URL, enter token provided in output.

Once the web-based configuration wizard launches, select the option Set up to start configuration wizard.

As you configured TLS encryption with Nginx reverse proxy, enter the Base URL and Application Listen Port as above.

Enter your desired credentials, then click Next.

Enter your license then click on Finish. If you don’t have a license, click on Get a 60-day evaluation license for 10,000 users to get an evaluation, follow the instruction to get the trial license.

You’re done! Enter your credentials and click on Login.

Conclusion

Congratulations on successfully installing YouTrack on your Ubuntu server! It’s time to start exploring YouTrack’s features. Dive into issue creation, customization, and management to make it work best for your team.

Reference

[1] https://www.jetbrains.com/help/youtrack/server/Install-YouTrack-ZIP-Installation.html

[2] https://www.jetbrains.com/help/youtrack/server/Reverse-Proxy-Configuration.html

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top