d0c955e1a311681845a618ece9b7691453c6df8c
[akkoma] / docs / docs / administration / updating.md
1 # Updating your instance
2
3 You should **always check the [release notes/changelog](https://akkoma.dev/AkkomaGang/akkoma/src/branch/stable/CHANGELOG.md)** in case there are config deprecations, special update steps, etc.
4
5 Besides that, doing the following is generally enough:
6 ## Switch to the akkoma user
7 ```sh
8 # Using sudo
9 sudo -su akkoma
10
11 # Using doas
12 doas -su akkoma
13
14 # Using su
15 su -s "$SHELL" akkoma
16 ```
17
18 ## For OTP installations
19 ```sh
20 # Download latest stable release
21 ./bin/pleroma_ctl update --branch stable
22
23 # Stop akkoma
24 ./bin/pleroma stop # or using the system service manager (e.g. systemctl stop akkoma)
25
26 # Run database migrations
27 ./bin/pleroma_ctl migrate
28
29 # Update frontend(s). See Frontend Configuration doc for more information.
30 ./bin/pleroma_ctl frontend install pleroma-fe --ref stable
31
32 # Start akkoma
33 ./bin/pleroma daemon # or using the system service manager (e.g. systemctl start akkoma)
34 ```
35
36 If you selected an alternate flavour on installation,
37 you _may_ need to specify `--flavour`, in the same way as
38 [when installing](../../installation/otp_en#detecting-flavour).
39
40 ## For from source installations (using git)
41 Run as the `akkoma` user:
42
43 ```sh
44 # fetch changes
45 git fetch
46 # check out the latest tag
47 git checkout $(git tag -l | grep -v 'rc[0-9]*$' | sort -V | tail -n 1)
48
49 # Run with production configuration
50 export MIX_ENV=prod
51
52 # Download and compile dependencies
53 mix deps.get
54 mix compile
55
56 # Stop akkoma (replace with your system service manager's equivalent if different)
57 sudo systemctl stop akkoma
58
59 # Run database migrations
60 mix ecto.migrate
61
62 # Update Pleroma-FE frontend to latest stable. For other Frontends see Frontend Configration doc for more information.
63 mix pleroma.frontend install pleroma-fe --ref stable
64
65 # Start akkoma (replace with your system service manager's equivalent if different)
66 sudo systemctl start akkoma
67 ```