Running OpenBoxes Locally
Installation Instructions
The following instructions describe the minimum steps required to build and run the application on your local machine.
If you're system administrator looking to deploy the application to a production server, you'll want to read through the installation documentation instead.
1. Install Dependencies
Each of the following will need to be installed on your local machine:
Installing Java and Grails
We recommend using SDK Man to easily install and manage your SDK versions. With it, you can install Java and Grails on the command line using:
sdk install java 8.0.452-zulu
sdk install grails 3.3.18Installing MariaDB (or MySQL)
You can install the SQL server via Advanced Package Tool:
sudo apt install mariadb-server-10.11.4Or for MySQL:
sudo apt install mysql-server-8.0The easiest way to install a compatible database is by using brew install mariadb.
Alternatively, ARM builds of MySQL 8 are available. Consider downloading 8.x LTS here.
Installing NPM and Node
You can install the Node and NPM via Advanced Package Tool:
There is no ARM build of Node 14 but you can run it via x86 emulation as follows:
/usr/sbin/softwareupdate --install-rosetta --agree-to-licenseInstall
nvm(only – do not installnodeitself) using these instructionsLaunch a terminal that uses Rosetta to pretend to be an x86 host:
arch -x86_64 bashWithin that terminal, run
nvm install 14Open up a new terminal and run the following command; you should see an
x86_64binary, which should be able to run successfully on an ARM host.
2. Configure the database instance
Create the openboxes database:
Create the "openboxes" user:
3. Create Openboxes configuration file
Create the ~/.grails/openboxes.yml file with the following contents:
No custom config is required. Move on to the next step.
4. Install NPM dependencies
If you haven't already, clone the repository, then cd to the main folder of the project and run:
5. Start the application
This will start the application in development mode using an internal Tomcat instance. This will also build all the remaining dependencies for the project. You may need to run the grails compile command beforehand, or run grails run-app several times in order to download all dependencies.
6. Log into OpenBoxes
Navigate to http://localhost:8080/openboxes and log in as an admin using the default credentials (username: admin and password: password). From there, you can create further accounts as needed.
Tips and tricks
Disable Background Jobs
There are many different background jobs that are periodically executed while the application server is running. Some of the jobs are ran every minute. This is slow, and can be quite resource intensive, so unless you need a job to be running, we recommend that you disable them when running the app locally.
To disable the jobs, add the following to your openboxes.yml:
Enable React Hot-Reloading
If you're doing development on the React frontend, you'll likely find it useful to run the frontend in hot-swap mode.
In addition to running the regular application server (via the grails run-app command) run the following command in a separate command-line process:
This will cause the fronted to rebuild itself automatically after any code change that you make. All you need to do is refresh the browser window to see the changes take effect. Without this line, you'd need to restart your server to have any React changes take effect.
In addition to this, now that you're building the frontend NPM dependencies yourself, you can comment out any lines in the build.gradle file that contain dependsOn 'npm_run_bundle'. This allows the backend to start much faster since it prevents it from also rebuilding the NPM depedencies.
Last updated
Was this helpful?

