# Start tryton server automatically

**URL:** <https://discuss.tryton.org/t/start-tryton-server-automatically/6410>\
**Category:** System Administrator\
**Created:** [August 4, 2023, 5:25pm UTC](https://discuss.tryton.org/t/start-tryton-server-automatically/6410 "2023-08-04T17:25:38Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![dortizmunoz](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/d/a88e4f/32.png) [@dortizmunoz](https://discuss.tryton.org/u/dortizmunoz)\
**Post date:** [August 4, 2023, 5:25pm UTC](https://discuss.tryton.org/t/start-tryton-server-automatically/6410/1 "2023-08-04T17:25:38Z")

</div>

It’s probably nonsense but I don’t know and I can’t find it here.

What I want is that when the Ubuntu Server starts (which I have in my case), I do this manually with this instruction: $ trytond -c /etc/tryton/trytond.conf

How can I make it automatic?

---

<div class="post-metadata">

**Author:** ![edbo](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/e/f14d63/32.png) [@edbo](https://discuss.tryton.org/u/edbo)\
**Post date:** [August 5, 2023, 9:09am UTC](https://discuss.tryton.org/t/start-tryton-server-automatically/6410/2 "2023-08-05T09:09:44Z")

</div>

Just a few hints 🙂

The internal webserver of Tryton is only for development purposes, so you need something like `uwsgi` or `gunicorn` to run Tryton. When you have that running, you can create a `systemd` service file which starts it all automatically on boot.

Personally I prefer `gunicorn` it’s a more general purpose wsgi server.

---

<div class="post-metadata">

**Author:** ![SISalp](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/sisalp/32/200_2.png) [@SISalp](https://discuss.tryton.org/u/SISalp)\
**Post date:** [August 5, 2023, 12:30pm UTC](https://discuss.tryton.org/t/start-tryton-server-automatically/6410/3 "2023-08-05T12:30:55Z")

</div>

You can start trytond as a service or as a daemon.  
Check your OS documentation.  
A quick a dirty solution is to start it as a detached process in /etc/rc.local.

Because I have a dynamic list of trytond servers to start and I want so start them sequentially, I end up by using crontab to activate a specific script.

Also be sure postgresql is fully started before you start trytond service.

---

<div class="post-metadata">

**Author:** ![dortizmunoz](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/d/a88e4f/32.png) [@dortizmunoz](https://discuss.tryton.org/u/dortizmunoz)\
**Post date:** [August 5, 2023, 6:40pm UTC](https://discuss.tryton.org/t/start-tryton-server-automatically/6410/4 "2023-08-05T18:40:03Z")

</div>

I will follow your suggestion.  
Once I have Gunicorn installed, how should I proceed?

---

<div class="post-metadata">

**Author:** ![SISalp](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/sisalp/32/200_2.png) [@SISalp](https://discuss.tryton.org/u/SISalp)\
**Post date:** [August 8, 2023, 12:16pm UTC](https://discuss.tryton.org/t/start-tryton-server-automatically/6410/5 "2023-08-08T12:16:28Z")

</div>

Which limitations did you find with out-of-the-box server ?

---

<div class="post-metadata">

**Author:** ![edbo](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/e/f14d63/32.png) [@edbo](https://discuss.tryton.org/u/edbo)\
**Post date:** [August 8, 2023, 5:28pm UTC](https://discuss.tryton.org/t/start-tryton-server-automatically/6410/6 "2023-08-08T17:28:03Z")

</div>

> [@SISalp](#):
>
> Which limitations did you find with out-of-the-box server ?

None, but the internal werkzeug wsgi server of Tryton is NOT to be used in production and only for development. In order to test properly in a more automated manner just install `Gunicorn` and a `systemd` file to start Tryton on boot. The internet is full of examples how to do this.

> [@dortizmunoz](#):
>
> Once I have Gunicorn installed, how should I proceed?

It depends on your configuration. How you installed Tryton and Gunicorn. Buth search for Flask and Gunicorn and you should be able to get it running ([Gunicorn - WSGI server — Gunicorn 23.0.0 documentation](https://docs.gunicorn.org/en/latest/)).

---

<div class="post-metadata">

**Author:** ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)\
**Post date:** [August 8, 2023, 5:34pm UTC](https://discuss.tryton.org/t/start-tryton-server-automatically/6410/7 "2023-08-08T17:34:27Z")

</div>

Currently the docker images are using µwsgi ([Replace µwsgi (#1) · Issues · Tryton / Tryton Docker · GitLab](https://foss.heptapod.net/tryton/tryton-docker/-/issues/1)).  
So we have an example of configuration in [6.8/uwsgi.conf · branch/default · Tryton / Tryton Docker · GitLab](https://foss.heptapod.net/tryton/tryton-docker/-/blob/branch/default/6.8/uwsgi.conf).

---

<div class="post-metadata">

**Author:** ![SISalp](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/sisalp/32/200_2.png) [@SISalp](https://discuss.tryton.org/u/SISalp)\
**Post date:** [August 8, 2023, 10:18pm UTC](https://discuss.tryton.org/t/start-tryton-server-automatically/6410/8 "2023-08-08T22:18:21Z")

</div>

> [@edbo](#):
>
> None

Same for me. If someone knows, any new argument would be useful.

---

<div class="post-metadata">

**Author:** ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)\
**Post date:** [August 8, 2023, 10:27pm UTC](https://discuss.tryton.org/t/start-tryton-server-automatically/6410/9 "2023-08-08T22:27:10Z")

</div>

It explained here: [Serving WSGI Applications — Werkzeug Documentation (3.1.x)](https://werkzeug.palletsprojects.com/en/2.3.x/serving/)

> Do not use the development server when deploying to production. It is intended for use only during local development. It is not designed to be particularly efficient, stable, or secure.

---

<div class="post-metadata">

**Author:** ![yangoon](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/y/67e7ee/32.png) [@yangoon](https://discuss.tryton.org/u/yangoon)\
**Post date:** [August 23, 2023, 10:11am UTC](https://discuss.tryton.org/t/start-tryton-server-automatically/6410/10 "2023-08-23T10:11:00Z")

</div>

Under specific conditions like high load, concurrency, etc. you will encounter errors with the development server.

You can have a look at [tryton-server not accepting new connections (#10921) · Issues · Tryton / Tryton · GitLab](https://foss.heptapod.net/tryton/tryton/-/issues/10921), which was the reason for [tryton-server: Should provide a ready-to-use production-grade server config](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=998319), which then yielded [Recent improvements to Tryton’s Debian Packaging](https://www.freexian.com/blog/tryton-funded-projects/).
