metal.md (4891B)
1 # Bare metal 2 3 This guide walks you through getting GoToSocial up and running on bare metal using the official binary releases. 4 5 ## Prepare VPS 6 7 In a terminal on the VPS or your homeserver, make the directory that GoToSocial will run from, the directory it will use as storage, and the directory it will store LetsEncrypt certificates in: 8 9 ```bash 10 mkdir /gotosocial && mkdir /gotosocial/storage && mkdir /gotosocial/storage/certs 11 ``` 12 13 If you don't have root permissions on the machine, use something like `~/gotosocial` instead. 14 15 ## Download Release 16 17 In a terminal on the VPS or your homeserver, cd into the base directory for GoToSocial you just created above: 18 19 ```bash 20 cd /gotosocial 21 ``` 22 23 Now, download the latest GoToSocial release archive corresponding to the operating system and architecture you're running on. 24 25 (You can find the list of releases [right here](https://github.com/superseriousbusiness/gotosocial/releases), arranged with the newest release at the top.) 26 27 For example, to download version 0.5.2 for running on 64-bit Linux: 28 29 ```bash 30 wget https://github.com/superseriousbusiness/gotosocial/releases/download/v0.5.2/gotosocial_0.5.2_linux_amd64.tar.gz 31 ``` 32 33 Then extract it: 34 35 ```bash 36 tar -xzf gotosocial_0.5.2_linux_amd64.tar.gz 37 ``` 38 39 This will put the `gotosocial` binary in your current directory, in addition to the `web` folder, which contains assets for the web frontend, and an `example` folder, which contains a sample configuration file. 40 41 ## Edit Configuration File 42 43 Copy the configuration file from the example folder into your current directory: 44 45 ```bash 46 cp ./example/config.yaml . 47 ``` 48 49 Now open the file in your text editor of choice so that you can set some important configuration values. Change the following settings: 50 51 - Set `host` to whatever hostname you're going to be running the server on (eg., `example.org`). 52 - Set `port` to `443`. 53 - Set `db-type` to `sqlite`. 54 - Set `db-address` to `sqlite.db`. 55 - Set `storage-local-base-path` to the storage directory you created above (eg., `/gotosocial/storage`). 56 - Set `letsencrypt-enabled` to `true`. 57 - Set `letsencrypt-cert-dir` to the certificate storage directory you created above (eg., `/gotosocial/storage/certs`). 58 59 The above options assume you're using SQLite as your database. If you want to use Postgres instead, see [here](../../configuration/database.md) for the config options. 60 61 ## Run the Binary 62 63 You can now run the binary. 64 65 Start the GoToSocial server with the following command: 66 67 ```bash 68 ./gotosocial --config-path ./config.yaml server start 69 ``` 70 71 The server should now start up and you should be able to access the splash page by navigating to your domain in the browser. Note that it might take up to a minute or so for your LetsEncrypt certificates to be created for the first time, so refresh a few times if necessary. 72 73 Note that for this example we're assuming that we're allowed to run on port 443 (standard https port), and that nothing else is running on this port. 74 75 ## Create your user 76 77 You can use the GoToSocial binary to also create and promote your user account. This is all documented in our [Creating users](../user_creation.md) guide. 78 79 ## Login 80 81 You should now be able to log in to your instance using the email address and password of the account you just created. We recommend using [Semaphore](https://semaphore.social) or [Tusky](https://tusky.app) for this. 82 83 ## (Optional) Enable the systemd service 84 85 If you don't like manually starting GoToSocial on every boot you might want to create a systemd service that does that for you. 86 87 First stop your GoToSocial instance. 88 89 Then create a new user and group for your GoToSocial installation: 90 91 ```bash 92 sudo useradd -r gotosocial 93 sudo groupadd gotosocial 94 sudo usermod -a -G gotosocial gotosocial 95 ``` 96 97 Then make them the owner of your GoToSocial installation since they will need to read and write in it: 98 99 ```bash 100 sudo chown -R gotosocial:gotosocial /gotosocial 101 ``` 102 103 You can find a `gotosocial.service` file in the `example` folder on [github](https://raw.githubusercontent.com/superseriousbusiness/gotosocial/main/example/gotosocial.service) or your installation. 104 105 Copy it to `/etc/systemd/system/gotosocial.service`: 106 107 ```bash 108 sudo cp /gotosocial/example/gotosocial.service /etc/systemd/system/ 109 ``` 110 111 Then use `sudoedit /etc/systemd/system/gotosocial.service` to change the `ExecStart=` and `WorkingDirectory=` lines according to your installation. 112 113 If you have been following this guide word for word the defaults should be fine. 114 115 After you're done enable the service: 116 117 ```bash 118 sudo systemctl enable --now gotosocial.service 119 ``` 120 121 ## (Optional) Reverse proxy 122 123 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.