gtsocial-umbx

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

container.md (5690B)


      1 # Container
      2 
      3 This guide walks you through getting GoToSocial up and running using the official container images we publish. In this case we'll be using the Docker runtime directly through [Docker Compose](https://docs.docker.com/compose) together with SQLite as the database.
      4 
      5 You can also run GoToSocial using a container orchestration system such as [Kubernetes](https://kubernetes.io/) or [Nomad](https://www.nomadproject.io/), but that is beyond the scope of this guide.
      6 
      7 ## Create a Working Directory
      8 
      9 You need a working directory in which your docker-compose file will be located, and a directory for GoToSocial to store data in, so create these directories with the following command:
     10 
     11 ```bash
     12 mkdir -p ~/gotosocial/data
     13 ```
     14 
     15 Now change to the working directory you created:
     16 
     17 ```bash
     18 cd ~/gotosocial
     19 ```
     20 
     21 ## Get the latest docker-compose.yaml
     22 
     23 Use `wget` to download the latest [docker-compose.yaml](https://raw.githubusercontent.com/superseriousbusiness/gotosocial/main/example/docker-compose/docker-compose.yaml) example, which we'll customize for our needs:
     24 
     25 ```bash
     26 wget https://raw.githubusercontent.com/superseriousbusiness/gotosocial/main/example/docker-compose/docker-compose.yaml
     27 ```
     28 
     29 ## Edit the docker-compose.yaml
     30 
     31 Because GoToSocial can be configured using [Environment Variables](../../configuration/index.md#environment-variables), we can skip mounting a config.yaml file into the container, to make our configuration simpler. We just need to edit the docker-compose.yaml file to change a few things.
     32 
     33 First open the docker-compose.yaml file in your editor of choice. For example:
     34 
     35 ```bash
     36 nano docker-compose.yaml
     37 ```
     38 
     39 ### Version
     40 
     41 If desired, update the GoToSocial Docker image tag to the version of GtS you want to use.
     42 
     43 `latest`   - the default. This points to the latest stable release of GoToSocial.
     44 
     45 `snapshot` - points to whatever code is currently on the main branch. Not guaranteed to be stable, and may often be broken. Use with caution.
     46 
     47 !!! tip
     48     You can also replace `latest` with a specific GoToSocial version number. This is recommended when you want to make sure that you don't update your GoToSocial version by accident, which can cause problems. The list of releases can be found [right here](https://github.com/superseriousbusiness/gotosocial/releases), with the newest release at the top. Replace `latest` in the docker-compose.yaml with the number of the desired release (without the leading `v` or trailing version name).
     49 
     50 ### Host
     51 
     52 Change the `GTS_HOST` environment variable to the domain you are running GoToSocial on.
     53 
     54 ### User (optional / probably not necessary)
     55 
     56 By default, Dockerized GoToSocial runs with Linux user/group `1000:1000`, which is fine in most cases. If you want to run as a different user/group, you should change the `user` field in the docker-compose.yaml accordingly.
     57 
     58 For example, let's say you created the `~/gotosocial/data` directory for a user with id `1001`, and group id `1001`. If you now try to run GoToSocial without changing the `user` field, it will get a permissions error trying to open its database file in the directory. In this case, you would have to change the `user` field of the docker compose file to `1001:1001`.
     59 
     60 ### LetsEncrypt (optional)
     61 
     62 If you want to use [LetsEncrypt](../../configuration/tls.md) for TLS certificates (https), you should also:
     63 
     64 1. Change the value of `GTS_LETSENCRYPT_ENABLED` to `"true"`.
     65 2. Remove the `#` before `- "80:80"` in the `ports` section.
     66 3. (Optional) Set `GTS_LETSENCRYPT_EMAIL_ADDRESS` to a valid email address to receive certificate expiry warnings etc.
     67 
     68 ## Start GoToSocial
     69 
     70 With those small changes out of the way, you can now start GoToSocial with the following command:
     71 
     72 ```shell
     73 docker-compose up -d
     74 ```
     75 
     76 After running this command, you should get an output like:
     77 
     78 ```text
     79 Creating network "gotosocial_gotosocial" with the default driver
     80 Creating gotosocial ... done
     81 ```
     82 
     83 If you want to follow the logs of GoToSocial, you can use:
     84 
     85 ```bash
     86 docker logs -f gotosocial
     87 ```
     88 
     89 If everything is OK, you should see something similar to the following:
     90 
     91 ```text
     92 time=2022-04-19T09:48:35Z level=info msg=connected to SQLITE database
     93 time=2022-04-19T09:48:35Z level=info msg=MIGRATED DATABASE TO group #1 (20211113114307, 20220214175650, 20220305130328, 20220315160814) func=doMigration
     94 time=2022-04-19T09:48:36Z level=info msg=instance account example.org CREATED with id 01EXX0TJ9PPPXF2C4N2MMMVK50
     95 time=2022-04-19T09:48:36Z level=info msg=created instance instance example.org with id 01PQT31C7BZJ1Q2Z4BMEV90ZCV
     96 time=2022-04-19T09:48:36Z level=info msg=media manager cron logger: start[]
     97 time=2022-04-19T09:48:36Z level=info msg=media manager cron logger: schedule[now 2022-04-19 09:48:36.096127852 +0000 UTC entry 1 next 2022-04-20 00:00:00 +0000 UTC]
     98 time=2022-04-19T09:48:36Z level=info msg=started media manager remote cache cleanup job: will run next at 2022-04-20 00:00:00 +0000 UTC
     99 time=2022-04-19T09:48:36Z level=info msg=listening on 0.0.0.0:8080
    100 ```
    101 
    102 ## Create your first User
    103 
    104 Now that GoToSocial is running, you should create at least a user for yourself. How to do so is documented in our [Creating users](../user_creation.md) guide.
    105 
    106 ### Done
    107 
    108 GoToSocial should now be running on your machine! To verify this, open your browser navigate to whatever you set as your `GTS_HOST` value. You should see the GoToSocial landing page. Well done!
    109 
    110 ## (Optional) Reverse Proxy
    111 
    112 If you want to run other webservers on port 443 or want to add an additional layer of security you might want to use a [reverse proxy](../reverse_proxy/index.md). We have guides available for a couple of popular open source options and will gladly take pull requests to add more.