Windows Server (advanced)¶
If you are just testing your app on your personal computer, you can use
otree zipserver or
otree devserver. You don’t need a full server setup as described below,
which is necessary for sharing your app with an audience.
This section is for people who are experienced with setting up web servers. If you would like an easier and quicker way, we recommend using Heroku.
Why do I need to install server software?¶
oTree’s development setup (
is not designed for running actual studies.
If you want, you can use Postgres as your production database.
Install Postgres and psycopg2, create a new database and set the
DATABASE_URL env var, for example:
However, in principle, oTree 3.0+ should do fine with its default SQLite in production, since the server is now is single threaded.
If all the above steps went well, you should be able to run
You should download and run Redis for Windows.
Redis should be running on port 6379. You can test with
which should output
REDIS_URL env var to
redis://localhost:6379 in the same place where you set
Run the production server¶
otree prodserver 80
See here for full instructions. The steps are essentially the same as on Linux.
Set environment variables¶
You should set