CollabVM Server 1.x/Server setup for beginners

This guide is intended to help get you setup with CollabVM 1.2.11 along with an NGINX server to handle your requests. You may host it publicly or run it privately. These instructions are tested only with Debian 11 and CollabVM 1.2.11. If you vary, you will have to substitute commands for your own. Basic Linux knowledge is strongly recommended.

= Installation =

Basic server requirements

 * OS: Windows is not supported (but works). As said, these instructions are tested with Debian 11. Most Linux distributions will work, however.
 * CPU: Preferably one which supports hardware virtualization. It is not required, but performance may suffer without it.
 * RAM: You will need enough RAM to host your OS, CollabVM and the associated virtual machine. Have at least 2 GB of RAM free.
 * Disk: Technically you need only about 50 megabytes of storage to run CollabVM, however you will need space for NGINX and your associated VM. Have atleast 4 GB of free storage, much more (>16GB) if you are hosting full Windows VMs.
 * Permissions: You'll likely need root-level access to the server you're using in order to install packages for the system. However, collab-vm-server should NEVER be run as root! (or administrator privileges, when on Windows)

collab-vm-server setup
Do the following under a user with limited privileges (with the exception of sudo commands, if you wish): The collab-vm-binary is now compiled and ready to be used. It doesn't provide a proper HTTP server though, so it will not run
 * 1) You will need to grab the required libraries and some additional tools for collab-vm-server:
 * 2) Next, you'll want to clone (download) the collab-vm-server repository:
 * 3) Now, change directory:
 * 4) Since we will run collab-vm-server under NGINX, we will need to modify two files:
 * 5) * Using the editor of your choice, edit the file  inside the CollabVM source code. Remove the double slashes in the line containing.
 * 6) * The next file to edit is . Here, look for a line containing  . Change the   to
 * 7) ** What we've done here is make it so CollabVM listens only on localhost. This way, malicious users cannot spoof their IP address by setting headers.
 * 8) To compile collab-vm-server, execute this command:
 * 9) * If you would not like JPEG support (not recommended!) you can leave out the  flag. Do not disable this unless you know what you are doing.
 * 10) * Note that this command will also use all of your cores, if you would like to utilize less cores, replace  with the amount of cores you'd like to use
 * 1) * Note that this command will also use all of your cores, if you would like to utilize less cores, replace  with the amount of cores you'd like to use

Webapp setup
Again, continue doing the following here under a user with limited privileges.

Main webapp

 * 1) Go back 1 directory:
 * 2) Install node.js:
 * 3) First, you need curl:
 * 4) Run this command:
 * 5) Then install it:
 * 6) Get the web app:
 * 7) Change directory into the webapp
 * 8) Install the required packages:
 * 9) And install gulp globally:
 * 10) Time to edit another file:
 * 11) * Edit, look for the line containing  , change it to
 * 12) Now run , let it build the web app.

Admin webapp

 * 1) Go back 1 directory, once again:
 * 2) Grab the admin webapp:
 * 3) Now change directory into the admin webapp
 * 4) Then install the packages, once again:
 * 5) We need to modify the same file:
 * 6) * Edit, this time replacing   with
 * 7) Now run gulp once again:

Constructing your HTTP directory
We will be creating the directory in, please substitute the commands as needed. Now you have a working HTTP root for your Collab VM installation. We will be using NGINX in the next step in order to host this directory.
 * 1) First we will create the directory:
 * 2) Now we will add a file inside:
 * 3) * Create the file  with the following content:
 * 4) Next, copy the main webapp into your www directory:   (Don't forget the  )
 * 5) And the admin webapp:

NGINX installation
We will be installing and configuring NGINX to host our webapp and proxy connections to the collab-vm-server instance. In this case, we are using port 6004, with collab-vm-server using port 6005 and our root directory being the same as previously. We are also not accepting IPv6 connections, which may need some additional configuration. Now, visit your server's IP address on port 6004. If the IP address were, then visit http://192.168.1.100:6004/ in your browser. It should load the CollabVM interface with an endless loading spinner.
 * 1) First, install NGINX:
 * 2) Next, you will want to add an additional site configuration to NGINX.
 * 3) * Create the file, and insert the following contents inside. If needed, substitute the values as necessary. Root privileges might be required to edit this file.
 * 4) Now, enable and start NGINX using these commands: