-
If you have not already done so, download
and install the latest version of R for Windows. Install Rserve as well.
-
Ensure that you can run the Rserve executable (Rserve.exe) without error.
If you installed R in the default location on a 64-bit machine, the executable will be here (but maybe with a different version number):
C:\Program Files\R\R-3.6.1\bin\x64\Rserve\libs\x64\Rserve.exe
Note that the first time we double-clicked on Rserve.exe, we were greeted with this error:
Adding the full path to our R libs folder (C:\Program Files\R\R-3.6.1\bin\x64) to the PATH system environment variable resolved the problem:
-
Download and install AlwaysUp, if necessary.
-
Start AlwaysUp.
-
Select Application > Add to open the Add Application window:
-
On the General tab:
-
In the Application field, enter the full path to the Rserve executable, Rserve.exe.
We found it here on our machine:
C:\Program Files\R\R-3.6.1\bin\x64\Rserve\libs\x64\Rserve.exe
-
In the Name field, enter the name that you will call the application in AlwaysUp.
We have stuck with the default of Rserve but you can specify another name if you like.
-
Click over to the Logon tab and enter the username and password of the account in which you installed and run Rserve.
Rserve should run in this account to find any settings you have configured.
And if you're on Windows 8/7 or Server 2016/2012/2008, we recommend checking the
Hide the application's windows in Session 0 to avoid annoying alerts from the Interactive Services Detection service as Rserve chugs away in the background.
-
Switch to the Startup tab and check the Ensure that the Windows networking components have started box.
Rserve communicates via TCP/IP and this option will keep the server from starting before the network is ready.
-
We're done configuring Rserve as a service so click the Save button to record your settings.
In a couple of seconds, an application called Rserve will show up in the AlwaysUp window.
It is not yet running though and the state will be "Stopped":
-
To start Rserve from AlwaysUp, choose Application > Start "Rserve". In a few seconds, the status will change to "Running":
Click the green circle to show the details of the running process:
-
That's it! Next time your computer boots, Rserve will start up immediately, in the background, without anyone needing to log on.
Please restart your PC now and test that everything works as expected after Windows comes back to life.
And please feel free to edit Rserve in AlwaysUp to check out the many other settings that may be appropriate for your environment.
For example, send email alerts if it stops, restart the server nightly to cure memory leaks, boost Rserve's priority to support computationally expensive tasks, and much more.