The Moebius README contains some information to run a Moebius Server that might be slightly too technical for some of us. This post is an attempt to provider more elaborate instructions.
First of all, Moebius Server is intended to run on a machine with direct internet access, it needs a pulbic IP address. If you intend running the server on your internet connection at home you will very likely need Port Forwarding (also known as Port Mapping) to be done on your router. Your Internet Service Provider should have instructions to set up such a port forwarding. Setting this up is beyond the scope of this post, but you may find more information on how to do this on sites like portforward.com or alternatively you can use a free service like portmap.io to set it up. But you need to know that you need to map at least TCP port 8000 from your router to the machine on your network which is going to run the Moebius Server. If you want to web preview, youâll also need TCP port 8080.
Moebius requires nodejs to run, so move over the nodejs download page and download the installer for your platform. The installation is very straightforward and youâll be good with just accepting all defaults.
Next download Moebius. The official README suggests doing this with âgitâ, but itâs not required, you can also download the âsource code (.zip)â from the release page (donât donwload version 1.0.28 as it has a server startup bug). Extract this ZIP file on your hard drive.
Now youâll need to execute some commands in a terminal window, on Windows this is called a âCommand Promptâ on MacOS itâs âTerminalâ. In this window you need to navigate to the location where you extracted the Moebius source. This is done with the âcdâ command, on Windows for example youâd enter the following command (assuming youâve extracted your ZIP file in C:)
cd C:\Moebius-1.0.29
Now you need to install the package and itâs dependencies. This is fully automatic and will take a few minutes to complete, enter the following command:
npm install
Youâll get the prompt returned to you when itâs done. When this completes you have a functional Moebius client and server. The server needs a document to start with, it wonât start without but it can be empty. To create an empty document on Windows type:
type nul > server.ans
On MacOS or Linux youâd type:
touch server.ans
Now youâre ready to start the Moebius Server with itâs default settings by entering:
node ./server.js
The first time you do this, your operating system might warn you about the application using network connectivity, youâll need to alllow this. Typically on Windows this would like this:
Once the server runs youâll see â/: startedâ in the output, in this screen youâll see log messages such as users connecting and chatter. Youâre now ready to test connecting to you server, start Moebius on the same machine and as server name enter âlocalhostâ, the password field may be left empty. Moebius will now connect to your local server.
When youâve done all of the above your terminal should look like this:
To stop the server on Windows/Linux press Ctrl-C (Windows) on MacOS press Cmd-. (dot/period) Again, to be able to connect to your Moebius Server on your home connection from the internet, you need to set up Port Forwarding. (see above).
The server.js script accepts some additional parameters that allow you to modify the way it runs, the possible parameters are:
- âfile=filename.ans : the initial file to load, by default: server.ans
- âpassw=P4ssW0rd : set a password for this Moebius Server, by default any value is accepted.
- âweb : run the web preview. this is a webpage that shows a live preview of the canvas and can be access on the same host on port 8080
- âweb_port=8080 : this option changes the port of the live preview
- âquiet=true/false: suppress the output in the terminal window
- âserver_port: modify the port the server listens to (defaults to 8000), mind that changing this requires explicit mention of the port in the client.
To use these parameters you should add them as a parameters to server.js, for example
node ./server.js --file=filename.ans --passw=kensentme --web --quiet=true