1# GoToSocial {#module-services-gotosocial}
2
3[GoToSocial](https://gotosocial.org/) is an ActivityPub social network server, written in Golang.
4
5## Service configuration {#modules-services-gotosocial-service-configuration}
6
7The following configuration sets up the PostgreSQL as database backend and binds
8GoToSocial to `127.0.0.1:8080`, expecting to be run behind a HTTP proxy on `gotosocial.example.com`.
9
10```nix
11{
12 services.gotosocial = {
13 enable = true;
14 setupPostgresqlDB = true;
15 settings = {
16 application-name = "My GoToSocial";
17 host = "gotosocial.example.com";
18 protocol = "https";
19 bind-address = "127.0.0.1";
20 port = 8080;
21 };
22 };
23}
24```
25
26Please refer to the [GoToSocial Documentation](https://docs.gotosocial.org/en/latest/configuration/general/)
27for additional configuration options.
28
29## Proxy configuration {#modules-services-gotosocial-proxy-configuration}
30
31Although it is possible to expose GoToSocial directly, it is common practice to operate it behind an
32HTTP reverse proxy such as nginx.
33
34```nix
35{
36 networking.firewall.allowedTCPPorts = [
37 80
38 443
39 ];
40 services.nginx = {
41 enable = true;
42 clientMaxBodySize = "40M";
43 virtualHosts = with config.services.gotosocial.settings; {
44 "${host}" = {
45 enableACME = true;
46 forceSSL = true;
47 locations = {
48 "/" = {
49 recommendedProxySettings = true;
50 proxyWebsockets = true;
51 proxyPass = "http://${bind-address}:${toString port}";
52 };
53 };
54 };
55 };
56 };
57}
58```
59
60Please refer to [](#module-security-acme) for details on how to provision an SSL/TLS certificate.
61
62## User management {#modules-services-gotosocial-user-management}
63
64After the GoToSocial service is running, the `gotosocial-admin` utility can be used to manage users. In particular an
65administrative user can be created with
66
67```ShellSession
68$ sudo gotosocial-admin account create --username <nickname> --email <email> --password <password>
69$ sudo gotosocial-admin account confirm --username <nickname>
70$ sudo gotosocial-admin account promote --username <nickname>
71```