Pleroma
Overview
This guide shows how to deploy and configure Pleroma on Ubuntu 24.04 on Azure using SecureAnyCloud Azure Marketplace images. Pleroma is an open-source, self-hosted social networking server for the Fediverse. It speaks the ActivityPub protocol, so your instance federates with Mastodon, Misskey and the wider Fediverse. People on your server follow, reply to and boost posts with accounts anywhere else in the network.
Pleroma is written in Elixir on PostgreSQL and is deliberately lightweight, so a single small VM comfortably runs a personal server or a small community. It serves a familiar microblogging timeline through its built-in web interface (pleroma-fe) and is compatible with the Mastodon client API, so most existing mobile and desktop apps work against it directly. You own and control the instance, the data and the moderation, on infrastructure in your own Azure subscription.
The SecureAnyCloud image ships the free and open-source, AGPL-3.0 licensed Pleroma release, installed the officially supported way from the upstream Erlang/OTP release (pinned by SHA-256) and paired with on-box PostgreSQL 16. Pleroma binds to the loopback interface only, PostgreSQL never leaves loopback, and nginx terminates TLS as the single public listener. Pleroma ships no default administrator, so first boot creates everything unique to each VM: the Phoenix secret_key_base, the session signing salts, the web push (VAPID) keypair, the JWT signer, the PostgreSQL password, the administrator account and password, a self-signed TLS certificate, and an outer web credential that gates anonymous access at the proxy.
Pleroma is a trademark of its respective owner. This image is produced by SecureAnyCloud and is not affiliated with, endorsed by, or sponsored by the Pleroma project. It ships the free and open-source AGPL-3.0 licensed software, unmodified. The corresponding source is available at https://git.pleroma.social/pleroma/pleroma.
What you get:
- Pleroma 2.10.2, the official upstream Erlang/OTP release, pinned by SHA-256 and run unmodified under systemd
- PostgreSQL 16, the application database, bound to loopback with no host port published
- nginx, the single public listener, which terminates TLS and is the only way to reach the Pleroma server
- First-boot secret generation for
secret_key_base, signing salts, web push keypair, JWT signer, database password, administrator account, TLS certificate and web credential, all unique to each VM - A bundled self-test that logs in as the per-instance administrator, posts a status and reads it back from the instance's own timeline, proving the server works end to end
- 24/7 SecureAnyCloud support
Prerequisites
- An Azure subscription with permission to create virtual machines
- An SSH key pair for administrative access
- A network security group that allows inbound TCP 22 (SSH) and TCP 443 (HTTPS) from your own address ranges
- A VM size of
Standard_B2s(2 vCPU, 4 GB RAM) or larger - For real federation with other Fediverse servers, a public DNS name that points at the VM and a CA-issued TLS certificate (covered in Federation and a real domain below). Pleroma federates by hostname, so a bare IP address with a self-signed certificate is fine for evaluation but not for joining the wider network.
Deploy from the Azure Portal
- Open the Azure Marketplace and search for Pleroma on Ubuntu 24.04 LTS by SecureAnyCloud.
- Select Create, and then choose your subscription, resource group and region.
- Pick a VM size of
Standard_B2sor larger. - Under Administrator account, select SSH public key and supply your public key.
- Under Inbound port rules, allow SSH (22) and HTTPS (443).
- Select Review + create, and then select Create.
Deploy from the Azure CLI
az group create --name pleroma-rg --location eastusaz vm image terms accept --urn sac1647283583153:pleroma-ubuntu-24-04:default:latest
az vm create \
--resource-group pleroma-rg \
--name pleroma-vm \
--image sac1647283583153:pleroma-ubuntu-24-04:default:latest \
--size Standard_B2s \
--admin-username azureuser \
--generate-ssh-keys \
--public-ip-sku Standard
az vm open-port --resource-group pleroma-rg --name pleroma-vm --port 443 --priority 1010Connect to your VM
ssh azureuser@<vm-ip>Confirm the services are running
Pleroma runs as a systemd service behind nginx, with PostgreSQL on the same VM. Two one-shot units run once on first boot. pleroma-firstboot creates the per-VM secrets and configuration before the server is allowed to start, and pleroma-postboot creates the per-VM administrator once the server is up. Check that the services are active:
systemctl is-active postgresql nginx pleromaExpected output:
active active activeThe Pleroma server listens only on the loopback interface, and nginx is the single public listener on ports 80 (which redirects to HTTPS) and 443. Rather than grepping for the ports you expect, list every socket that is bound to something other than loopback. This way, anything unexpected shows up:
sudo ss -ltn | awk 'NR>1{print $4}' | grep -vE '^(127\.|\[::1\])' | sort -uThe only entries are 22 (SSH) and 80 and 443 (nginx), on both IPv4 and IPv6. Everything else that the image runs is bound to loopback and is not reachable from off the VM. This includes Pleroma itself on 127.0.0.1:4000, PostgreSQL on 127.0.0.1:5432 and the Erlang port mapper on 127.0.0.1:4369.
Because the command lists the full set rather than a filtered subset, you can also run it again after you install anything else on the VM.
Retrieve your per-instance credentials
Every VM generates its own secrets and administrator on first boot. They are written to a root-only file. Read it with:
sudo cat /root/pleroma-credentials.txtThis file contains:
WEB_USERandWEB_PASSWORDare the outer HTTP Basic credential that gates anonymous access at the nginx proxy.ADMIN_USER,ADMIN_EMAILandADMIN_PASSWORDare the per-instance Pleroma administrator account.PLEROMA_URLis the HTTPS URL of your instance.
Keep this file safe, and change the passwords once you have logged in.
Understand the security model
Pleroma has no published default administrator. Accounts are only ever created explicitly. The security-sensitive values that upstream would otherwise leave you to set are all generated uniquely on the first boot of every VM, before the server is reachable:
- The Phoenix
secret_key_baseand the session signing salts, which sign and encrypt session cookies - The web push VAPID keypair and the JWT signer
- The PostgreSQL password
- The per-instance administrator account and password
- A per-instance self-signed TLS certificate
- A per-instance web credential for the nginx gate
The two layers of authentication, the nginx Basic gate and Pleroma's own account login, both use the HTTP Authorization header. The image therefore configures nginx to let authenticated API traffic (which carries a Bearer token) through to Pleroma's own authentication, while it challenges anonymous visitors for the web credential. The web UI, the mobile apps and the API all work normally behind the gate.
You can verify the model end to end with the bundled self-test. It proves that the front door refuses a missing or wrong credential, that a wrong administrator password is rejected, and that a status posted through the real login is read back from the timeline:
sudo /usr/local/sbin/pleroma-roundtrip.shLog in to the web interface
Open your instance in a browser:
https://<vm-ip>/The TLS certificate is self-signed and unique to the VM, so your browser warns once. Accept the warning to continue, or install a CA certificate for a real domain as described below to remove it. You then authenticate in two steps:
- When the browser prompts for the web credential, enter
WEB_USERandWEB_PASSWORDfrom your credentials file. - On the Pleroma sign-in page, log in as
ADMIN_USERwithADMIN_PASSWORD.
After you sign in, you land on your timeline, ready to post.
Post to your timeline
Write a post in the compose box and publish it. The post appears immediately on your local timeline. Once your instance federates (see below), it is also delivered to your followers on other Fediverse servers.
The same works from any Mastodon-compatible app. Point the app at https://<vm-ip>/ (or your domain), and log in with the administrator account.
Manage users from the command line
Self-registration is closed by default on this image, which is a single-administrator appliance. Create additional accounts, or grant moderator and admin rights, with pleroma_ctl:
# create a regular user (they can log in and post); -y skips the confirmation prompt
sudo -Hu pleroma bash -c 'cd /opt/pleroma && PLEROMA_CONFIG_PATH=/etc/pleroma/config.exs ./bin/pleroma_ctl user new alice alice@example.com --password "$(openssl rand -base64 18)" -y'To open public registration instead, set registrations_open: true in /etc/pleroma/config.exs and restart Pleroma:
sudo sed -i 's/registrations_open: false/registrations_open: true/' /etc/pleroma/config.exs
sudo systemctl restart pleromaFederation and a real domain
Pleroma federates by hostname, and every post and account carries the instance's configured URL. Real federation therefore needs a stable public DNS name and a CA-issued certificate, rather than a bare IP address with a self-signed certificate.
- Point a DNS
Arecord (for examplesocial.example.com) at your VM's public IP address. - Set the instance host in
/etc/pleroma/config.exs:
elixir config :pleroma, Pleroma.Web.Endpoint, url: [host: "social.example.com", scheme: "https", port: 443] 3. Issue a real certificate (for example with Certbot), point nginx at it in /etc/nginx/sites-available/pleroma, and then reload nginx. 4. Restart Pleroma: sudo systemctl restart pleroma.
Federation identifiers are derived from the hostname, so choose your domain before you start following accounts elsewhere. Changing it afterwards breaks existing federation.
Backups
All state lives in the on-box PostgreSQL database and in the uploads directory. To back up both:
sudo -u postgres pg_dump pleroma | gzip > pleroma-$(date +%F).sql.gz
sudo tar czf pleroma-uploads-$(date +%F).tar.gz -C /var/lib/pleroma uploadsStore both files off the VM.
Support
Every SecureAnyCloud image includes 24/7 support and is tested against the exact build you launch. If anything in this guide does not match what you see, contact SecureAnyCloud support at sales@secureanycloud.com.
Deploy on Azure
Launch Pleroma on Ubuntu 24.04 LTS on Azure with 24/7 support from SecureAnyCloud.
View this image
Need Help?
Our support team is available 24/7.
sales@secureanycloud.com