Skip to content
Title: Railway Hobby: Edge Access Rules and Persistent Volume Permissions
Anonymous
OP

5 days ago

Hello Railway team,

I'm evaluating Railway Hobby for a private staging environment for a Next.js application.

Before subscribing, I'd appreciate clarification on two capabilities:

  1. Private access: Can Hobby enforce an allowlist of approved IPv4 testers followed by a default-deny rule covering all application routes, APIs, downloads, attached domains and IPv6 traffic? Are there any rule limits or additional charges?

  2. Persistent storage: What is the supported way to initialize a persistent volume with appropriate ownership and permissions while keeping the application process running as a non-root user? Do those permissions survive redeployment, restart, reattachment and backup restoration?

I'd appreciate links to the relevant documentation or confirmation of any limitations on the Hobby plan.

Thank you.

Awaiting User Response

5 Replies

Railway
BOT

5 days ago

Edge rules can handle the private-access part. Rules are set per service and environment, and they apply to every domain attached to that service. They run from top to bottom, and the first matching allow or block rule decides what happens to the request. To set this up, add an allow rule that matches your testers' IPv4 addresses or CIDR ranges with is in, then add a block rule below it that matches every path (path matches /*). That block rule covers app routes, APIs and downloads.

Client IP conditions only match IPv4, and a request with no IPv4 source never matches an IP condition. IPv6 requests therefore skip the allow rule and hit the catch-all block. Edge rules need a public domain and a plan that includes edge rules. The rule editor shows your plan's rule-count limit. Each ruleset is also limited to 64 entries per is in list, 32 conditions per rule and 64 KiB of JSON in total. See Edge rules.

For storage, volumes are mounted as root when the container starts. They are not available at build time or during the pre-deploy command. For images that use a non-root user, the documented setting is RAILWAY_RUN_UID=0, which runs the process as root. Volumes are not mounted as overlays, so ownership changes made at runtime are written to the volume itself. We haven't verified how ownership and permissions behave after a backup restore or after reattaching a volume. See Volumes and Backups.


Status changed to Awaiting User Response Railway • 5 days ago


Railway

Edge rules can handle the private-access part. Rules are set per service and environment, and they apply to every domain attached to that service. They run from top to bottom, and the first matching allow or block rule decides what happens to the request. To set this up, add an allow rule that matches your testers' IPv4 addresses or CIDR ranges with **is in**, then add a block rule below it that matches every path (path **matches** `/*`). That block rule covers app routes, APIs and downloads. Client IP conditions only match IPv4, and a request with no IPv4 source never matches an IP condition. IPv6 requests therefore skip the allow rule and hit the catch-all block. Edge rules need a public domain and a plan that includes edge rules. The rule editor shows your plan's rule-count limit. Each ruleset is also limited to 64 entries per **is in** list, 32 conditions per rule and 64 KiB of JSON in total. See [Edge rules](https://docs.railway.com/networking/edge-rules). For storage, volumes are mounted as `root` when the container starts. They are not available at build time or during the pre-deploy command. For images that use a non-root user, the documented setting is `RAILWAY_RUN_UID=0`, which runs the process as root. Volumes are not mounted as overlays, so ownership changes made at runtime are written to the volume itself. We haven't verified how ownership and permissions behave after a backup restore or after reattaching a volume. See [Volumes](https://docs.railway.com/volumes) and [Backups](https://docs.railway.com/volumes/backups).

Anonymous
OP

5 days ago

Thank you for the clarification.

The edge-rule explanation addresses the IPv4/IPv6 access design. However, could you please confirm these two remaining points?

  1. Does the Railway Hobby plan currently include edge rules? If so, what is its exact rule limit?

  2. Is there a Railway-supported procedure for initializing a persistent volume's directory ownership and permissions while keeping the main application process non-root, without setting RAILWAY_RUN_UID=0?

In particular, can a separate privileged initialization process safely prepare the mounted volume before the application starts, and are the resulting permissions guaranteed to survive redeployment, reattachment and backup restoration?

These are required conditions for our staging environment. We would appreciate confirmation before proceeding.


Status changed to Awaiting Railway Response Railway • 5 days ago


Railway
BOT

5 days ago

Edge rules need a plan that includes an edge-rule allowance, and the rule editor in your service's Edge settings shows the exact rule count for your workspace's plan. We can't confirm a specific Hobby rule count from here, so please check that editor before you subscribe. The other per-ruleset limits from our earlier reply apply on every plan. See Edge rules.

For volumes, the supported way to run a non-root image with a volume is RAILWAY_RUN_UID=0. A pre-deploy command can't prepare the volume, because volumes aren't mounted during pre-deploy. They're mounted only when the container starts, so any ownership setup has to happen in the start command, inside the running container. Volumes aren't mounted as overlays, so ownership changes made at runtime are written to the volume itself and persist on it. We can't guarantee those permissions will survive reattachment or a backup restore. See Volumes and Backups.


Status changed to Awaiting User Response Railway • 5 days ago


Railway

Edge rules need a plan that includes an edge-rule allowance, and the rule editor in your service's Edge settings shows the exact rule count for your workspace's plan. We can't confirm a specific Hobby rule count from here, so please check that editor before you subscribe. The other per-ruleset limits from our earlier reply apply on every plan. See [Edge rules](https://docs.railway.com/networking/edge-rules). For volumes, the supported way to run a non-root image with a volume is `RAILWAY_RUN_UID=0`. A pre-deploy command can't prepare the volume, because volumes aren't mounted during pre-deploy. They're mounted only when the container starts, so any ownership setup has to happen in the start command, inside the running container. Volumes aren't mounted as overlays, so ownership changes made at runtime are written to the volume itself and persist on it. We can't guarantee those permissions will survive reattachment or a backup restore. See [Volumes](https://docs.railway.com/volumes) and [Backups](https://docs.railway.com/volumes/backups).

Anonymous
OP

5 days ago

Thank you for the clarification. The proposed configuration still has two unresolved requirements.

Our application must run as a non-root user, and persistent private files must remain accessible after redeployment, volume reattachment and backup restoration.

Could a Railway technical representative confirm whether there is a supported way to meet these requirements without running the main application as root?

We would also appreciate confirmation of the exact Edge Rules allowance on the Hobby plan.

We need these answers before approving staging deployment or subscribing.


Status changed to Awaiting Railway Response Railway • 5 days ago


Railway
BOT

5 days ago

For the non-root requirement, the only volume permissions setup we document is RAILWAY_RUN_UID=0, which starts the container as root because volumes are mounted as root. We don't offer a separate privileged initialization step that prepares the volume before the application starts. Pre-deploy commands also can't do it, because volumes aren't mounted at that stage. So we can't confirm a supported way to meet all your requirements without the container starting as root, and we can't guarantee file ownership will carry over after a volume reattachment or a backup restore. Changes written to the volume at runtime do stay on the volume across redeploys and restarts. See Volumes.

For edge rules, they require a plan that includes an edge-rule allowance, and the exact rule count for your workspace's plan appears in the rule editor in your service's Edge settings. We can't give you a specific Hobby rule count here. See Edge rules.


Status changed to Awaiting User Response Railway • 5 days ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...