How to Install Lila on OpenSUSE Latest

Lichess is a free and open-source online chess server that allows users to play chess games, participate in tournaments or solve puzzles. Lila is its chess variant engine that implements variants of chess like Crazyhouse or Antichess. In this tutorial, you will learn how to install Lila on OpenSUSE Latest.

Prerequisites

Before we begin, ensure that you have the following requirements:

Installation

  1. We'll start by installing some dependencies:

    sudo zypper install git-core gcc make sbt
    
  2. Next, we'll clone Lila's git repository:

    git clone git://github.com/ornicar/lila.git
    
  3. Move into the lila directory and create a new file lila.conf:

    cd lila/
    cp conf/lila.prod.conf conf/lila.conf
    nano conf/lila.conf
    

    The conf file is important. We'll edit it to reflect your domain and other settings.

    In the conf file, change the following as needed:

    domain = "your-domain.com"
    mongodb-uri = "mongodb://localhost:27017/lila"
    

    Make sure to replace your-domain.com with your actual domain name.

  4. Configure Lila. You can use the provided conf/lila.prod.conf file as a reference but some adjustments will have to be made to suit your needs. Open the file in your preferred text editor:

    nano conf/lila.prod.conf
    

    In the file, modify the following lines:

    play.crypto.secret = "abcdefghijk9908409285"
    lila.host = "your_domain_name:8080" # Replace "your_domain_name" with the actual domain name
    lila.port = play.http.port = 8080
    
  5. Build Lila with:

    sbt build
    

    This may take some time.

  6. Once the build is complete, start Lila with:

    target/universal/stage/bin/lila
    

    This will web-serve Lila at 127.0.0.1:8080. We'll set Lila up to be accessible via its domain/UI web interface instead of the local IP. To do so, use a reverse proxy like nginx.

  7. Install nginx and configure it to point to Lila:

    sudo zypper install nginx
    sudo nano /etc/nginx/nginx.conf
    

    Add the following inside the server block:

    location / {
        proxy_pass http://127.0.0.1:8080;
        proxy_set_header X-Real-IP $remote_addr;
        add_header P3P 'CP="IDC CSS ADM DEVi TAIi PSAi \
                              IVAi IVDi CONi HISi TELi OUR \
                              SAMi IND ONL PUR COM NAV \
                              INT DEM CNT STA PRE LOC"';
        add_header Access-Control-Allow-Origin *;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_connect_timeout 300;
    }
    

    Save changes and restart nginx:

    sudo systemctl enable nginx
    sudo systemctl start nginx
    

    You should now be able to access Lila via http://your-domain.com in your web browser.

Conclusion

In this tutorial, we installed and configured Lila on OpenSUSE Latest. You can now play chess, participate in tournaments and solve puzzles from your server.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!