Run on Virtual Machine/Bare Metal
To achieve maximum flexibility, you may run OneDev on virtual machine or bare metal machine
Resource Requirement
OneDev can run happily on a 2 core 2GB box. For personal use, 1 core 1GB box also works. In this case, you will need to edit <OneDev dir>/conf/wrapper.conf
to comment out property wrapper.java.maxmemory.percent=50
and uncomment wrapper.java.maxmemory=256m
Installation
Make sure your system has Java 11 or higher installed and available in system path. On ArchLinux, also make sure to run below commands to install required fonts:
sudo pacman -S fontconfig ttf-dejavu
Make sure your system has git 2.11.1 or higher installed and available in system path
On Linux and Mac, make sure your system has curl installed and available in system path
Select desired OneDev release and download
onedev-<release>.zip
oronedev-<release>.tar.gz
Extract downloaded file into selected installation directory. Make sure current user has full permissions to the directory and all its sub directories
Open a command prompt, change to the installation directory, and run command bin\server.bat console (on Windows) or bin/server.sh console (on Unix/Linux/Mac) to start the server
Run as System Service
On Windows Platform
Edit file
<OneDev dir>\conf\wraper.conf
to set value of propertywrapper.java.command
as path to java command if it does not exist in system pathOpen a command prompt with administrator privilege and switch to folder
<OneDev dir>\bin
Run command
server.bat install
. A Windows service with name OneDev will be installedTo uninstall the service, run command
server.bat remove
from the same folder with administrator privilege
On Linux and Mac OS X
Edit file
<OneDev dir>/conf/wraper.conf
to set value of propertywrapper.java.command
as path to java command if it does not exist in system pathBy default, the service will run under root user. To run as another user, edit file
<OneDev dir>/bin/server.sh
and uncomment below line to specify the user. Make sure specified user has full permissions to OneDev directory and all its sub directories:#RUN_AS_USER=
Run command
sudo <OneDev dir>/bin/server.sh install
to install the serviceTo uninstall the service, run command
sudo <OneDev dir>/bin/server.sh remove
Use External Database
OneDev by default uses the embedded HSQL database for demonstration purpose. For production usage, it is highly recommended to switch to external database for reliability and performance reason. OneDev can work with below databases:
- MySQL 5.0 or higher
- SQL Server 2008 or higher
- PostgreSQL 9.0 or higher
- MariaDB 5.0 or higher
To switch to use one of above databases, follow below steps (assume OneDev is installed at /opt/onedev):
- Stop OneDev server by running /opt/onedev/bin/server.sh stop (or run server.bat on Windows)
- Run command /opt/onedev/bin/backup.(sh|bat) /path/to/backup-file
- Edit file /opt/onedev/conf/hibernate.properties to comment out the HSQLDB section and uncomment the section of your desired external database. Also provide connection details to your database
- Create a blank external database matching connection details of above step
- Run command /opt/onedev/bin/restore.(sh|bat) /path/to/backup-file
- Start OneDev server and check if everything is fine
Procedure is the same if you want to switch to a different external database than current external database.
Increase Ulimit
If you have many projects, you may encounter the "too many open files" issue on Linux/Mac platform. In this case, please increase ulimit of the user running OneDev process. There are a lot of guides on how to do this, for instance: https://www.google.com/search?q=increase+ulimit+ubuntu