Mirror from bluesky-social/pds
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

add installer script

+63 -31
+63 -31
README.md
··· 21 21 * [Canonical TypeScript code](https://github.com/bluesky-social/atproto) 22 22 * [Experimental Go code](https://github.com/bluesky-social/indigo) 23 23 24 - ## Self-hosting a PDS 24 + ## Self-hosting PDS 25 25 26 26 Self-hosting a Bluesky PDS means running your own Personal Data Server that is capable of federating with the wider Bluesky social network. 27 27 28 - ### Launch your server 28 + ### Preparation for self-hosting PDS 29 29 30 30 Launch a server on any cloud provider, [Digital Ocean](https://digitalocean.com/) and [Vultr](https://vultr.com/) are two popular choices. 31 + 32 + Ensure that you can ssh to your server and have root access. 31 33 32 34 **Server Requirements** 33 35 * Public IPv4 address ··· 35 37 * Public inbound internet access permitted on port 80/tcp and 443/tcp 36 38 37 39 **Server Recommendations** 38 - 39 40 | | | 40 41 | ---------------- | ---------------- | 41 - | Operating System | Ubuntu 22.04 LTS | 42 + | Operating System | Ubuntu 22.04 | 42 43 | Memory (RAM) | 2+ GB | 43 44 | CPU Cores | 2+ | 44 45 | Storage | 40+ GB SSD | 45 46 | Architectures | amd64, arm64 | 46 47 47 - ### Install your server 48 - 49 - Install your Ubuntu 22.04 server, and then ensure that you can ssh to it. 50 - 51 48 **Note:** It is a good security practice to restrict inbound ssh access (port 22/tcp) to your own computer's public IP address. You can check your current public IP address using [ifconfig.me](https://ifconfig.me/). 52 49 53 - ### Open your firewall 50 + ### Open your cloud firewall for HTTP and HTTPS 54 51 55 52 One of the most common sources of misconfiguration is not opening firewall ports correctly. Please be sure to double check this step. 56 53 57 - It may be helpful to use a remote [port scanning](https://dnschecker.org/port-scanner.php) service to verify that access is permitted. Once your server is fully configured, this service should display the ports as open. 58 - 59 - #### Open ports on your cloud provider's firewall 60 - 61 54 In your cloud provider's console, the following ports should be open to inbound access from the public internet. 62 55 63 56 * 80/tcp (Used only for TLS certification verification) ··· 65 58 66 59 **Note:** there is no need to set up TLS or redirect requests from port 80 to 443 because the Caddy web server, included in the Docker compose file, will handle this for you. 67 60 68 - #### Open ports on your Linux firewall 69 - 70 - If your server is running a Linux firewall managed with `ufw`, you will also need to open these same ports on the server itself. 71 - 72 - ```bash 73 - $ sudo ufw allow 80/tcp 74 - $ sudo ufw allow 443/tcp 75 - ``` 76 - 77 61 ### Configure DNS for your domain 78 62 79 63 From your DNS provider's control panel, set up a domain with records pointing to your server. ··· 89 73 * Some providers may use the `@` symbol to represent the root of your domain. 90 74 * The wildcard record is required when allowing users to create new accounts on your PDS. 91 75 76 + 77 + 78 + ## Automatic install on Ubuntu 22.04 or Debian 11 79 + 80 + On your server via ssh, run the installer script: 81 + 82 + ```bash 83 + curl https://raw.githubusercontent.com/bluesky-social/pds/main/installer.sh | sudo bash 84 + ``` 85 + 86 + ## Installing manually on Ubuntu 22.04 87 + 88 + ### Open ports on your Linux firewall 89 + 90 + If your server is running a Linux firewall managed with `ufw`, you will also need to open these same ports on the server itself. 91 + 92 + ```bash 93 + $ sudo ufw allow 80/tcp 94 + $ sudo ufw allow 443/tcp 95 + ``` 96 + 92 97 ### Install Docker 93 98 94 99 On your server, install Docker CE (Community Edition), using the the following instructions. For other operating systems you may reference the [official Docker install guides](https://docs.docker.com/engine/install/). ··· 211 216 * `watchtower` Daemon responsible for auto-updating containers to keep the server secure and federating 212 217 213 218 ```bash 214 - curl https://raw.githubusercontent.com/bluesky-social/pds/main/compose.yaml >compose.yaml 219 + curl https://raw.githubusercontent.com/bluesky-social/pds/main/compose.yaml | sudo tee /pds/compose.yaml 215 220 ``` 216 221 222 + #### Create the systemd service 223 + 224 + ```bash 225 + cat <<SYSTEMD_UNIT_FILE >/etc/systemd/system/pds.service 226 + [Unit] 227 + Description=Bluesky PDS Service 228 + Documentation=https://github.com/bluesky-social/pds 229 + Requires=docker.service 230 + After=docker.service 231 + 232 + [Service] 233 + Type=oneshot 234 + RemainAfterExit=yes 235 + WorkingDirectory=/pds 236 + ExecStart=/usr/bin/docker compose --file /pds/compose.yaml up --detach 237 + ExecStop=/usr/bin/docker compose --file /pds/compose.yaml down 238 + 239 + [Install] 240 + WantedBy=default.target 241 + SYSTEMD_UNIT_FILE 242 + ``` 217 243 218 - #### Run docker compose 244 + #### Start the service 219 245 220 - Run `docker compose up` to start the three required containers. 246 + ```bash 247 + sudo systemctl daemon-reload 248 + ``` 221 249 222 250 ```bash 223 - sudo docker compose up --wait --detach 251 + sudo systemctl start pds 224 252 ``` 225 253 226 - You should see output similar to this: 254 + **Ensure that containers are running** 227 255 256 + There should be a caddy, pds, and watchtower container running. 257 + 258 + ```bash 259 + sudo systemctl status pds 228 260 ``` 229 - [+] Running 3/3 230 - ✔ Container watchtower Healthy 1.1s 231 - ✔ Container pds Healthy 1.1s 232 - ✔ Container caddy Healthy 1.0s 261 + 262 + ```bash 263 + sudo docker ps 233 264 ``` 234 265 235 266 ### Verify your PDS is online ··· 248 279 1. Download the Bluesky app 249 280 1. Enter the URL of your PDS (e.g. `https://example.com/`) 250 281 1. Create an account 282 + 1. Create a post 251 283 252 284 ## PDS environment variables 253 285