A GitOps tool for managing services and applications deployed as Podman Quadlets.
Materia makes managing Podman containers easy: just install the single binary or run the container on your host, point it at a Git repository or OCI image containing your desired state, and Materia will keep everything in sync.
The general workflow looks like this:
- Materia syncs with a remote source, downloading a manifest that describes what components are assigned to the host.
- It installs new Quadlets and data files or updates existing ones, optionally templating them from age, sops, and other engines.
- It starts, stops, and restarts systemd services based on which files changed.
- When a component is no longer assigned to a host, Materia stops the related services and removes the now unnecessary files.
Want more details on how it works? See the materia update workflow diagram. Ready to run it yourself? Try the Quickstart guide or read on.
Main Documentation site: primamateria.systems
Online Manpages: latest
Example Materia Repository: here
Example Materia Component: dnsmasq component here
The following are run time requirements and reflect what systems Materia is tested on. It may work without the specified versions (especially the systemd requirement).
Materia will not work with Podman versions lower than 4.4, as that is the version Quadlets were introduced in.
- Podman 5.4 or higher
- Systemd v254 or higher
- AMD64 or ARM64 architecture
Materia supports running both root and rootless quadlets, however currently root is the more tested pathway.
Note: When running in a container Materia uses the Podman remote API; therefore some features may be limited by the host's Podman API version (i.e. the container may have Podman 5.8 but if the host is 5.3 you can't use volume backups).
If you are using dbus locking with dbus-broker, you will need to install the ./install/systems.primamateria.materia.conf config file.
Build from source using mise build. By default this will generate binaries for amd64 and arm64.
If you'd like to build without mise, you can do so through the normal go methods such as: go build -ldflags="-w -s" -o bin/materia-arm64 ./cmd/materia/
Grab a release tarball for your architecture from the releases page; both amd64 and arm64 are supported.
For obvious reasons, materia should only be run using podman as your container engine.
By default it is assumed you are running using root. If not, you'll need to update the bind mounts to their appropriate locations; see the manual for more details. By default materia uses XDG_DIR settings in rootless mode.
These volume mounts are exhaustive for teaching purposes.
podman run --name materia --rm \
--hostname <system_hostname> \
--network host \
--security-opt label=disable \ # optional, depending on OS security settings
-v /run/dbus/system_bus_socket:/run/dbus/system_bus_socket \ # needed to manage systemd units
-v /run/podman/podman.sock:/run/podman/podman.sock \ # needed to get container status
-v /var/lib/materia:/var/lib/materia \ # Where materia stores its source cache and component data
-v /etc/containers/systemd:/etc/containers/systemd \ # needed to install Quadlets
-v /usr/local/bin:/usr/local/bin \ # customizable, change to where ever you want scripts to be installed to
-v /etc/systemd/system:/etc/systemd/system \ # Needed to manage services, can also use /usr/local/lib/systemd/system/
-v /etc/materia/known_hosts:/root/.ssh/known_hosts:ro \ #Optional, used for git+ssh checkouts
-v /etc/materia/key.txt:/etc/materia/key.txt \ #Optional, used for age decryption
-v /etc/materia/materia_key:/etc/materia/materia_key \ # Optional, used for git+ssh checkouts
--env MATERIA_AGE__KEYFILE=/etc/materia/key.txt \
--env MATERIA_SOURCE__KIND="git" \
--env MATERIA_SOURCE__URL=https://github.com/stryan/materia_example_repo \
ghcr.io/stryan/materia:stable update
Note that some security settings may need to be adjusted based off your distro. For example, systems using AppArmor may require PodmanArgs=--security-opt=apparmor=unconfined.
See install for example Quadlets.
stable: Use the latest tagged release.
v: Specific tagged release.
latest: Latest push to master that passes integration tests.
Container images and binaries are signed with Cosign starting with v0.8. The latter attaches signed signature bundles on each release.
The cosign public key is available at ./cosign.pub and on the main project website.
Questions or bug reports are welcome! Please start a Discussion versus opening an Issue, as Materia does bug tracking outside of Github using git-bug. You can also submit bugs/suggestions or ask questions in the Matrix room.
For submitting features/bugfixes/code-in general via merge requests, please see the Contribution guide.