# Run as Docker Container ------ ### Resource Requirement OneDev can run happily on a 2 core 2GB box. ### Start OneDev Server Run below command on Linux/Mac: ``` docker run --name onedev -d --restart always -v :/var/run/docker.sock -v :/opt/onedev -p 6610:6610 -p 6611:6611 1dev/server ``` Here `` should be replaced with `/var/run/docker.sock` if docker runs in root mode, or `$XDG_RUNTIME_DIR/docker.sock` for rootless mode. `` replaced by a directory storing OneDev data Wait a while for OneDev to get up and running, then point your browser to `http://localhost:6610` to access it. If you want to run OneDev in foreground. Use below command: ``` docker run -t --name onedev --rm -v :/var/run/docker.sock -v :/opt/onedev -p 6610:6610 -p 6611:6611 1dev/server ``` Additionally, if you want to run OneDev with podman instead of docker: 1. Make sure podman system service is started 2. Run below command to start OneDev: ``` $ podman run -it --name onedev --rm -v $XDG_RUNTIME_DIR/podman/podman.sock:/var/run/docker.sock -v :/opt/onedev -p 6610:6610 -p 6611:6611 docker.io/1dev/server ``` **NOTE:** `` should be created first before running above command ### Use External Database OneDev by default uses an embedded database to store data. You may use environment variables below to connect to external database if desired.
(make sure to change url, user and password to fit your needs. The user needs to be able to create/delete/write tables in specified database)
1. MySQL * hibernate_dialect=org.hibernate.dialect.MySQL5InnoDBDialect * hibernate_connection_driver_class=com.mysql.cj.jdbc.Driver * hibernate_connection_url=jdbc:mysql://localhost:3306/onedev?serverTimezone=UTC&allowPublicKeyRetrieval=true&useSSL=false&disableMariaDbDriver=true * hibernate_connection_username=root * hibernate_connection_password=root 1. PostgreSQL * hibernate_dialect=io.onedev.server.persistence.PostgreSQLDialect * hibernate_connection_driver_class=org.postgresql.Driver * hibernate_connection_url=jdbc:postgresql://localhost:5432/onedev * hibernate_connection_username=postgres * hibernate_connection_password=postgres 1. MariaDB * hibernate_dialect=org.hibernate.dialect.MySQL5InnoDBDialect * hibernate_connection_driver_class=org.mariadb.jdbc.Driver * hibernate_connection_url=jdbc:mariadb://localhost:3306/onedev * hibernate_connection_username=root * hibernate_connection_password=root You also need to download MariaDB JDBC driver and put into directory `/site/lib` (this directory will be populated after first run of OneDev) 1. MS SQL Server * hibernate_dialect=org.hibernate.dialect.SQLServer2012Dialect * hibernate_connection_driver_class=com.microsoft.sqlserver.jdbc.SQLServerDriver * hibernate_connection_url=jdbc:sqlserver://localhost:1433;databaseName=onedev * hibernate_connection_username=sa * hibernate_connection_password=sa You also need to download SQL server JDBC driver and put into directory `/site/lib` (this directory will be populated after first run of OneDev) 1. Oracle * hibernate_dialect=org.hibernate.dialect.Oracle10gDialect * hibernate_connection_driver_class=oracle.jdbc.driver.OracleDriver * hibernate_connection_url=jdbc:oracle:thin:@localhost:1521:XE * hibernate_connection_username=onedev * hibernate_connection_password=onedev You also need to download Oracle JDBC driver and put into directory `/site/lib` (this directory will be populated after first run of OneDev) ### Additional Environment Variables For an unattended setup, you may pass below environment variables to prevent OneDev from poping up manual setup page for the first run: |---|---|---| | **Name** | **Required** | **Description** | | initial_user | Yes | Login name of administrator account | | initial_password | Yes | Password of administrator account | | initial_email | Yes | Email address of administrator account | | initial_server_url | Yes| Root url of this server | | initial_ssh_root_url | No | SSH root url of this server (will derive from *initial_server_url* if left empty) | As the name indicates, these environment variables are only used to initialize OneDev, and will not affect subseuqent changes.