Disclaimer: This guide is no longer up-to-date. Please find our updated guide here.
In this guide I am going to show you how to setup Monkersolver on a Debian 9 Linux server with Contabo.
Why use Linux?
You might ask yourself why you would want to go through the trouble of running Linux on a server for running Monkersolver. There are various reasons why you might want to do this, but the main advantage to running Linux on a server is cost reduction. With cloud computing companies such as Google and Amazon, the licensing fee for running Windows can cost over 4 USD per hour.
This is one of the most expensive use cases I could find, but it’s relevant if for example you want to test a setup before renting a large server for one or more months. Another common use case would be with a dedicated monthly rental where say a flat fee of 50 USD is applied for a Windows Server license. This might seem manageable, but it also equates to 600 USD per year in licensing fees that could have been avoided.
Additionally, being able to run Linux will save you money on your own builds, as a Windows license for personal use can cost 100 USD or more.
Where to Start?
For working with solvers and for use cases that require 256 GB RAM or less, I would recommend Contabo’s 10-core dedicated server (256 GB ECC RAM) because of the value at this price point. These can be upgraded to up to 20-cores (40 threads). I would recommend taking the upgrade as it’s relatively inexpensive and at the end of the day will save time in computing which more than makes up for the additional cost. A lot of the steps in this guide will also work with other cloud server service providers, but for the sake of simplicity, I will show the use case with Contabo.
Under ‘Dedicated Server 10-Core’, click on the ‘Customize & ORDER’ button. This will redirect you to a page where you can select the configuration of your server.
On the next page, you want to select ‘+ Intel Xeon E5 2630v4 (10 x 2.20 GHz)’ to get the upgrade to 20 cores.
In the next configuration section ‘Hard disks’ there are several viable options. For Monkersolver, disk speed only matters for loading and saving files, however this can actually take quite some time given the size of some of the solutions, so you want to use a fast drive. I would recommend selecting a regular SSD. 500 GB should be plenty for working with compressed solutions, and I would recommend regular backups to a cloud storage solution as opposed to paying for a lot of unused space.
In the final step of our configuration, you want to select ‘Debian 9’ as your operating system. Other versions of Linux would likely also work, but I’ve done the most testing under Debian 9 for Monkersolver, and so I would simply recommend that as an option. If you happen to be familiar with Ubuntu, you can also try Ubuntu. Ubuntu is a Debian based Linux distribution and so a lot of the following setup will be similar if not the same.
The remaining configuration options can be left as is and you can proceed by clicking the ‘Order now’ button.
Connecting to the server
After Contabo receives your payment, and after a short processing period, they will send you an email with your login data for the server.
Under Linux you can now use the command ‘ssh’ with your user name and password to connect to the server (e.g. ssh firstname.lastname@example.org). Under Windows you can use the program PuTTY to connect to your server using your ip address and the ssh port (e.g. xxx.xxx.xxx.xx:22). If you are using Mac OS, you can use the built-in terminal. Once you have connected to your server, you will be prompted for your password to complete the login process.
Installing VNC Server to obtain a Graphical User Interface
Monkersolver does not support command line interface (CLI) input at this point in time, and so you will require a graphical user interface (GUI) to interact with Monkersolver. So in order to have a GUI, we will need to install VNC server on our server. The following commands will help you set this up (hit enter after every command).
First we need to update the packages lists on our server:
Upgrade the packages on the package list:
apt-get -y upgrade
For our VNC server we will use ‘tightvncserver’, we will also install the XFCE desktop environment (DE) with some customizations. When prompted, type ‘y’ and press the ‘ENTER’ key:
apt-get install xfce4 xfce4-goodies gnome-icon-theme tightvncserver
You’re going to need a browser, as this setup doesn’t come with one out of the box. My personal preference is Chromium, but you could also use Chrome or Firefox for example:
apt-get install chromium
Later on we are going to make use of 7-zip:
apt-get install p7zip-full
We will also need to install the latest Java Runtime Environment (JRE) in order to run Monkersolver:
apt-get install default-jre
Setting up a VNC User
For security purposes, it is recommended to set up a separate account for running the VNC server using ‘sudo’, a program that restricts the privileges of it’s users.
Add the user vnc:
Choose a password, and skip all other questions by hitting the ‘ENTER’ key.
apt-get install sudo
Add the user vnc to the sudo group. This will allow it to execute root commands:
gpasswd -a vnc sudo
Now select the vnc user. You will need to use the vnc account every time you want to start or stop the vncserver:
su - vnc
Start the VNC Server
From the vnc account start the server:
vncserver -geometry 1920x1080
Here I am using the ‘-geometry’ option to specify the size of the output window on the machine from which I am viewing. You can set this to whichever resolution works best for you, 1920×1080 is for a 1080p or FHD monitor. If you do not use the ‘-geometry’ option, the server will output at it’s default of 800×600.
The first time you start the server, you will be asked to enter a password for connections to the server. You will need this password anytime you want to connect to your server, so keep that in mind for future use. The password length needs to be between 6-8 characters long. Optionally you can also set a password for a view-only account.
After you hit enter and choose your password, you will receive output with your display number:
'xauth: file /home/vnc/.Xauthority does not exist New 'X' desktop is vnc:1 Creating default startup script /home/vnc/.vnc/xstartup Starting applications specified in /home/vnc/.vnc/xstartup Log file is /home/vnc/.vnc/vnc:1.log'
The display number correlates to the number at the end of the VNC port, so for display 1, the corresponding port will be 5901, for 2 5902 etc.
If you want to stop the vnc server:
vncserver -kill :1
Where ‘:1’ refers to the display you are trying to stop. To stop the server on port 5902 you will need to use the command:
vncserver -kill :2
Connecting to your VNC Server
In order to connect to the GUI of your server, you are going to need a viewer. There are different programs you can use for this. On Windows, you can use UltraVNC.
In the field ‘VNC Server’ simply enter your server’s ip address and the port on which you have started your VNC server. For example: xxx.xxx.xxx.xx:5901. Hit ‘Connect’, next you should be prompted to input your server password. Now you should see your Debian desktop which should look something like this:
In order to install Monkersolver on Linux, you will need the installation file for Mac OS (.dmg). Typically this file we be placed in your download folder if you’ve downloaded it through your browser.
Open the terminal. In the XFCE DE 4.x, this can be found in the dock at the bottom of the screen (black box) or from the drop-down menu.
Once you have opened the terminal, navigate to the file in your download folder:
Now using 7-zip we are going to extract our .dmg file containing the Monkersolver files.
7z x monkersolver-setup.dmg
You may need to replace the file name with whatever the name of your file is. This will create a folder with all the contents of your .dmg file extracted. The name of the folder will share the name of the .dmg file.
Using the graphical interface, navigate to your ‘Downloads’ folder. You should see the folder ‘monkersolver-setup’. Double-click on the folder. Inside the folder, right-click on the file labelled ‘start2.sh’. Select ‘Properties’ under the ‘Permissions’ tab, tick the box ‘Allow this file tun run as a program’. Close the window.
Return to the terminal window and navigate to the extracted folder using the following command:
And that’s it! Now you have Monkersolver up and running on your server.
If you would like to see more Linux related content, please post your suggestions in the comment section below, and subscribe to our blog for more updates in the future.
It is strongly recommended that you restrict access to your server by following the steps in this guide in order to prevent bots from putting your server out of comission.
We have now released an updated version of this guide which you can find here.
Other related articles: