Template:Blacksmiths Setting up Locally: run server

Start the Habitica Web Server

 * 1) Ensure that the MongoDB database server is running. It should be if you have just completed the above steps, but if you are returning to your local install after a break, it might need to be restarted; refer to online MongoDB instructions for your operating system or ask in the Aspiring Blacksmiths (Habitica Coders) guild if you need help.
 * 2) Ensure that the time set on your computer or virtual machine is accurate to the nearest second, otherwise you will see "RequestTimeTooSkewed" errors.
 * 3) In one command prompt or terminal window, run the client build with . This will rebuild as you save changes to client files, and inform you of any errors.
 * 4) In a second command prompt or terminal, compile various files and start a web server with:


 * 1) Review the output of both of those commands as described below.

Review the Server Output
The output of the  command typically looks something like the image to the right. You are likely to see slight differences in your system (e.g., different dates, times, version numbers).

The inital output of the  command typically looks something like the image to the right and there will probably be a pause of at least several seconds before additional output appears, if any. As long as the additional output does not contain obvious error messages, everything is probably fine.

Significant differences to those screenshots might indicate a problem.

If you see an error like, edit the   file to add   as the final line. You'll find that file in the top level habitica directory (i.e., in the same directory as the config.json file). That fix will no longer be necessary if PR #10274 is merged.

If you see any other errors or warning messages, before going any further, resolve them yourself or report them using the guidelines in the "Prepare for Troubleshooting" section at the top of this page.

If the outputs from both  and   look good, proceed to the next section to test the website. If you're not completely sure if they are good or not, proceed anyway but if the website fails it's likely that you'll need to resolve problems shown in the outputs.

Test the Website in your Browser
Open a browser to http://localhost:8080 to test the application.

If you get to the website's front page but it doesn't finish loading or if you get to the login screen but the login button does nothing, clear local storage for the "localhost" domain. You can do that by clicking the red "Clear Data" button at http://localhost:8080/static/clear-browser-data or by using your browser's JavaScript console (google for information about how to clear local storage in your preferred browser). Then reload the front page.

Create one or more accounts for your testing. The database used by your local install is hosted on your machine; it is not the same database that is used by Habitica itself and so your normal Habitica account will not be available to you.

Next Steps: Using Your Local Install
Now that you have a working local install of the Habitica website, please read Using Your Local Install to Modify Habitica's Website and API to learn how to contribute code.

It is also important that you read Guidance for Blacksmiths, which has information about the technologies used, how the Habitica code is structured, ideas for how you can help, and other information.