41 minutes ago
Running rootless is usually a good practice and reduces attack vector. RAILWAY_RUN_UID=0 runs the container as root, thereby mitigating the benefits of running rootless.
Are there any extra security measures I can take/ recommended by railway staff for a secure experience?
I'm especially worried because of the recent attacks experienced by railway and other platforms, making security paramount.
3 Replies
40 minutes ago
RAILWAY_RUN_UID=0 is only needed when a volume is attached to a service whose image runs as a non-root user, because volumes are mounted as root (docs). Services without a volume can keep running as the non-root user defined in your image, so you can limit the root setting to the services that actually need persistent storage.
We don't expose container security contexts, capability sets, seccomp/AppArmor profiles, read-only root filesystems, or per-service egress firewalling on any plan, so those controls aren't available as additional settings.
On the recent incident, the final incident report covers what was accessed. Credentials stored in Railway before 09:25 UTC on October 21, 2026 should be rotated, while values first stored after that time were not exposed through that incident.
Status changed to Awaiting User Response Railway • 40 minutes ago
Railway
`RAILWAY_RUN_UID=0` is only needed when a volume is attached to a service whose image runs as a non-root user, because volumes are mounted as `root` ([docs](https://docs.railway.com/volumes)). Services without a volume can keep running as the non-root user defined in your image, so you can limit the root setting to the services that actually need persistent storage. We don't expose container security contexts, capability sets, seccomp/AppArmor profiles, read-only root filesystems, or per-service egress firewalling on any plan, so those controls aren't available as additional settings. On the recent incident, the [final incident report](https://blog.railway.com/p/incident-report-october-security-incident) covers what was accessed. Credentials stored in Railway before 09:25 UTC on October 21, 2026 should be rotated, while values first stored after that time were not exposed through that incident.
26 minutes ago
Services without a volume can keep running as the non-root user defined in your image
It was already implied that I am talking about services that need volumes with write access and not without.
On the recent incident, the final incident report covers what was accessed.>
My point still stands. I need to know if there are any security concerns I should be aware of prior to running my production in a service that runs as root.
Status changed to Awaiting Railway Response Railway • 26 minutes ago
25 minutes ago
With RAILWAY_RUN_UID=0, your process runs as root inside its own container. In practice, if your application is compromised, an attacker has full access to everything in that container, including the attached volume and the service's environment variables, rather than being limited to the files a non-root user could touch. That is the main thing to plan around, and it applies only to the services where you set the variable.
On the platform side, each environment has its own network namespace, so services in other projects, or in other environments of the same project, can't reach your service over the private network (security docs). On the October incident, we have no reason to believe the attacker ran commands inside customer containers. The access covered internal systems, stored build histories, environment variables and some linked-account tokens, and values first stored after 09:25 UTC on October 21, 2026 were not exposed (final report).
Our platform doesn't offer extra hardening settings for root containers beyond what our earlier reply described, so the remaining protections are in your image and application. Keep the service's variables limited to the secrets it actually needs, and keep the image and its dependencies patched.
Status changed to Awaiting User Response Railway • 25 minutes ago