Clockify consists of 3 main parts: API server, database server, and Web server. They can be on the same machine, but depending on the available resources you might want to deploy them on separate machines.

Database server #

You should first set up the database server, as API can’t run without it. API expects an instance of MongoDB v4.0 (or any later from the 4.x line).

Creating a database user

If we assume that:

$domain=mydomain
$username=admin
$password=UniqueAdminPasswordWeGaveYou

We should add the appropriate user with the following commands:

mongo --host $host
> use admin
> db.createUser({user:"$username", pwd:"$password", roles:[{role:"readWrite", db:"admin"}]})
> use clockify
> db.createUser({user:"$username", pwd:"$password", roles:[{role:"readWrite", db:"clockify"}]})

API server

API server uses Java. You need an official Oracle JVM that’s compatible with v1.8. Clockify API ships in a form of a JAR file that needs to be run with appropriate parameters.

$tokenKey=SomeRandomString

Running API server

If we assume that:

$profile=default,selfhosted
$environment=MyCompany
$domain=mydomain
$username=admin
$password=UniqueAdminPasswordWeGaveYou

We should run the API with the following command:

sudo java -jar -Dspring.profiles.active=$profile clockify-1.0.jar --authentication.token.xauth.key=$tokenKey --environment=$environment --database.mongoDb.databaseName=clockify --database.mongoDb.username=$username --database.mongoDb.password=$password --database.mongoDb.host=$host

Successfully configured API server will produce the console output similar to this:

INFO [main] [] com.clockify.BackendApplication : Started BackendApplication in 10.579 seconds (JVM running for 11.03)

Logs are stored on

/var/log/clockify/latest.log

It is recommended to run the Java process in the background. How you will configure this depends on your operating system.
API needs to be accessible from outside network under the /api path (for example time.mydomain.com/api). Again, configuration of this depends on the operating system and the web server in place.

Web server #

Web server hosts the static files that make the JavaScript frontend. Frontend ships as a compressed package that should be uncompressed and configured as a root of the web server of choice. How you will configure it depends on your web server.

Accessing the application #

Depending on the frontend configuration, you should be able to access the client application at:
https://time.mydomain.com

And admin dashboard at:
https://time.mydomain.com/admin

Initial credentials (you can always change email and password at https://time.mydomain/user/settings ) for the admin app are:

username: admin@clockify.me
password: UniqueAdminPasswordWeGaveYou

You can use admin panel to setup SSO, email delivery, default workspace, and other aspects of the system.