# Server maintenance / updates

**URL:** https://discourse.roots.io/t/server-maintenance-updates/4516
**Category:** trellis
**Created:** 2015-08-19T12:48:56Z
**Posts:** 5

## Post 1 by @richardwilis — 2015-08-19T12:48:56Z

What is the recommended way to keep a Trellis/Ansible provisioned server up to date with the latest packages and in particular security updates?

Can I simply add:

```
tasks:
  - apt: update_cache=yes
  - apt: upgrade=yes
```

to the `server.yml` file? And regularly run `ansible-playbook -i hosts/<environment> server.yml`  
Or does this conflict with the intended Trellis workflow?

---

## Post 2 by @swalkinshaw — 2015-08-19T15:45:27Z

Yes that would work but you should also test this on development/staging first. Package updates could obviously change their behaviour but they could also break things in Trellis. For example if a newer version changes the location of a path/file that Trellis references.

---

## Post 3 by @mAAdhaTTah — 2015-08-20T16:20:25Z

This happened to me, actually–nginx changed some configuration and reprovisioning resulted in a white screen, so definitely test locally first.

---

## Post 4 by @jasperfrumau — 2016-11-05T07:56:34Z

Would love to hear how you are managing things these days @richardwilis

---

## Post 5 by @richardwilis — 2016-11-05T09:44:15Z

I’ve installed the unattended upgrades package for security upgrades on the staging and live servers `sudo apt-get install unattended-upgrades`. I believe you can configure it to perform automatic security updates, but I just manually run `sudo unattended-upgrades -d`.

Occassionally I manually update the non-security packages. First on local and staging, then on the live server.
