# Configure Tryton server 5 (good practices or advices)

**URL:** https://discuss.tryton.org/t/configure-tryton-server-5-good-practices-or-advices/930
**Category:** User
**Created:** [December 4, 2018, 9:58am UTC](https://discuss.tryton.org/t/configure-tryton-server-5-good-practices-or-advices/930 "2018-12-04T09:58:17Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![maxx](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/maxx/32/2320_2.png) [@maxx](https://discuss.tryton.org/u/maxx)
#### Post date: [December 4, 2018, 9:58am UTC](https://discuss.tryton.org/t/configure-tryton-server-5-good-practices-or-advices/930/1 "2018-12-04T09:58:17Z")

</div>

Hi,

I’m upgrading an old version of Tryton server to 5.0 and i’m wondering what is the best practice for deploying Tryton server…

Before i used to clone trytond and needed modules from a specific branch (with hg clone -b …) and then  
hg npull to update all the modules (including my custom modules) with the hgnested extension.

Now with tryton-env (hg clone tryton-env) and the hook, it downloads all modules. I add my custom modules in /trytond/trytond/modules without symbolic link. (because all the symbolic links are deleted if not in the .hgsub file when doing hg pull)  
How to pull all the modules (included custom modules) in a single command like with hg npull ?

What is the best way to deploy a tryton server 5 on a linux server? How do you deal with your custom modules and the updates?  
Thanks for help, comments, answers…

---

<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: [December 4, 2018, 10:26am UTC](https://discuss.tryton.org/t/configure-tryton-server-5-good-practices-or-advices/930/2 "2018-12-04T10:26:09Z")

</div>

> [@maxx](#):
>
> What is the best way to deploy a tryton server 5 on a linux server? How do you deal with your custom modules and the updates?

We are doing all our deployment with the [Docker image](http://www.tryton.org/download#docker) and we customize it to include one custom module if needed.

For the development, we use a virtualenv an install Tryton in it. The custom module is installed with the `develop` setuptools command so we do not need to install it on each change.

---

<div class="post-metadata">

### Author: ![pokoli](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/pokoli/32/22_2.png) [@pokoli](https://discuss.tryton.org/u/pokoli)
#### Post date: [December 4, 2018, 10:38am UTC](https://discuss.tryton.org/t/configure-tryton-server-5-good-practices-or-advices/930/3 "2018-12-04T10:38:20Z")

</div>

> [@ced](#):
>
> We are doing all our deployment with the [Docker image](http://www.tryton.org/download#docker) and we customize it to include one custom module if needed.

If you don’t want to use the Docker boilerplate you can install the custom module on a virtualenv which will install all the required module dependencies (the ones listed on tryton.cfg).

We also use docker because as we find easier to manage upgrades: it’s just a mater of pulling the image instead of recreating the virtualenv and installing new dependencies.

---

<div class="post-metadata">

### Author: ![maxx](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/maxx/32/2320_2.png) [@maxx](https://discuss.tryton.org/u/maxx)
#### Post date: [December 4, 2018, 12:36pm UTC](https://discuss.tryton.org/t/configure-tryton-server-5-good-practices-or-advices/930/4 "2018-12-04T12:36:53Z")

</div>

> [@pokoli](#):
>
> If you don’t want to use the Docker boilerplate you can install the custom module on a virtualenv which will install all the required module dependencies (the ones listed on tryton.cfg).

So you proceed with a “python setup.py install” with your custom module… but how do you update your custom module if there’s any changes in your repo ? hg pull -u and then setup.py install again ?

I never used setup.py before for the server installation. In a virtualenv, i used to clone needed modules in the trytond/trytond/modules directory and then “trytond-admin --all …” to update. And to update all the modules to the latest version, it was with “hg npull -u”. It seems easy…  
What about updating the modules with a docker image ? How does-it works if you patch a module and you need to update ? Do you need to recreate a docker image ?

---

<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: [December 4, 2018, 12:47pm UTC](https://discuss.tryton.org/t/configure-tryton-server-5-good-practices-or-advices/930/5 "2018-12-04T12:47:34Z")

</div>

> [@maxx](#):
>
> but how do you update your custom module if there’s any changes in your repo ? hg pull -u and then setup.py install again ?

That’s why I use `python setup.py develop` it install the module in the virtualenv but in-place.  
When I want to get latest releases, I just run `python setup.py develop -U`

> [@maxx](#):
>
> What about updating the modules with a docker image ?

You do not need as the docker image are rebuild every week with the latest versions.

> [@maxx](#):
>
> How does-it works if you patch a module and you need to update ?

We do not patch modules. At best, we have in the custom module an override to implement bugfixes which are not back-ported. Usually we use a sub-module with the name of the issue to ease its removal later when upgrading.

> [@maxx](#):
>
> Do you need to recreate a docker image ?

You need to extend the docker image if you want to put more code in it. And of course, you need to rebuild it if you want to get the new version of the image.

---

<div class="post-metadata">

### Author: ![fmorato](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/fmorato/32/109_2.png) [@fmorato](https://discuss.tryton.org/u/fmorato)
#### Post date: [December 4, 2018, 3:51pm UTC](https://discuss.tryton.org/t/configure-tryton-server-5-good-practices-or-advices/930/6 "2018-12-04T15:51:19Z")

</div>

It is also possible to install the custom module with it’s repository link via pip.

---

<div class="post-metadata">

### Author: ![semarie](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/semarie/32/112_2.png) [@semarie](https://discuss.tryton.org/u/semarie)
#### Post date: [December 5, 2018, 7:31am UTC](https://discuss.tryton.org/t/configure-tryton-server-5-good-practices-or-advices/930/7 "2018-12-05T07:31:25Z")

</div>

> [@maxx](#):
>
> Now with tryton-env (hg clone tryton-env) and the hook, it downloads all modules. I add my custom modules in /trytond/trytond/modules without symbolic link. (because all the symbolic links are deleted if not in the .hgsub file when doing hg pull)  
> How to pull all the modules (included custom modules) in a single command like with hg npull ?

I think you should simply not use the hook. this way you have a per default empty `trytond/modules` directory. You should just manage manually symlinks for modules you want installed.

to update, simply use `hg pull -u` and it will update the whole repository and all modules.

---

<div class="post-metadata">

### Author: ![maxx](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/maxx/32/2320_2.png) [@maxx](https://discuss.tryton.org/u/maxx)
#### Post date: [December 5, 2018, 8:51am UTC](https://discuss.tryton.org/t/configure-tryton-server-5-good-practices-or-advices/930/8 "2018-12-05T08:51:53Z")

</div>

> [@semarie](#):
>
> I think you should simply not use the hook. this way you have a per default empty `trytond/modules` directory. You should just manage manually symlinks for modules you want installed.
> 
> to update, simply use `hg pull -u` and it will update the whole repository and all modules.

Indeed, thanks. But i suppose if i add my custom modules in the trytond/modules directory, they won’t be updated. (hgnested with the npull command was really useful for this case). But i’ll test commands from the others answers. Thanks to all for your replies! I’m sure there is not only one good method to deploy the tryton server but i think it is helpful to know how people are installing tryton following the environment (production, dev, … ) and which tools are bests to use and to make installation and updates easy to maintain (including custom modules in the scenario). So feel free to continue this discuss to share your experiences! 🙂
