If you are using a Formhub local server, it is not necessary to always have the server turned on. You might be conducting a data collection campaign in a setting where access to a power source might be limited (e.g. you are always moving locations, power source available only at certain times of the day) or there is limited internet connectivity (e.g. Wi-Fi and/or mobile signal only available in certain locations). In such situations, it wouldn’t make sense to keep the Formhub local server always on as it would waste stored power in the computer’s internal batteries and form submissions from ODK Collect devices are probably done only at specified days and times when the mobile devices are within the same local area network as the server. In fact, it is in settings where there is either limited power options or limited internet connectivity or both that you would specifically consider using a locally-deployed ODK server rather than a cloud- or internet-based ODK server.
Given this, it would be important that you are able to turn on and turn off the locally-deployed server correctly.
An important point to remember about locally-deployed servers is that they almost always consist of a front end and a back end component. The front end is usually the interface that allows the user to interact with the functionalities and capabilities provided for by the back end while the back end is the ‘workhorse’ that makes all the functionalities possible.
From the perspective of ‘turning off’ or ‘shutting down’ a server or other similar applications, it would be crucial to not only close the front end of the application (e.g. closing the application window such as a web browser) but also to shut down the back end component.
This tutorial describes how to turn off a locally-deployed Formhub server. This tutorial assumes that:
- You have a locally-deployed Formhub server. This guide shows you the step-by-step process of setting up a local Formhub server.
- You already know how to turn on a locally-deployed Formhub server. This tutorial shows how to initiate a locally-deployed Formhub server.
- You are able to access the front end of the Formhub server via the local area network address of the server.
1. Close the Formhub webpage accessed via the local IP address
You will then be left with the terminal window and the Oracle VM VirtualBox Manager on your screen as shown below.
2. Login as root on the server virtual machine
On the terminal window, type ‘root’ after the login prompt (1) and then press ‘Enter’.
A prompt for the password will appear (2). Type the password. The password is all4one. Password is spelling specific and case-sensitive. As a security measure, when you type the password, nothing will appear on the terminal window so as to hide the password you are entering. Once you have entered the password, press ‘Enter’.
If you have entered the password correctly, you will see the following on the terminal window.
You will be able to confirm that you are now logged in as root when you see the prompt on the terminal window showing the following:
3. Shutdown server
Now, at the prompt at the terminal window, type in the following command to shutdown the server:
shutdown -h now
You’ll know that you have issued the right command when you see the following text come out onto the terminal window.
Once the server has finished shutting down, the terminal window will close and you will now be left with only the Oracle VM VirtualBox Manager on your screen with the Formhub server indicated as ‘Powered Off’ (1). Once you have reached this, you can now just simply close the Oracle VM VirtualBox Manager by clicking on the X on the upper right hand corner of the application window (2).
Congratulations! You have successfully shutdown the Formhub local server.