Deploy Microsoft SQL Server 2022
SQL Server 2022 with persistent storage. EULA and edition choice required.
MicrosoftSQL
Just deployed
/var/opt/mssql
Deploy and Host Microsoft SQL Server 2022 on Railway
SQL Server 2022 CU26 with a digest-pinned official Linux image, a persistent /var/opt/mssql volume, a generated initial sa password, and TCP access on container port 1433. You must personally accept the Microsoft EULA and explicitly choose an eligible edition/license before SQL Server can start.
About Hosting Microsoft SQL Server 2022
The template does not choose Developer on your behalf and a Railway subscription does not include a Microsoft SQL Server license. Required ACCEPT_EULA has no default; required MSSQL_PID is explicitly empty to override the image's inherited Developer fallback. Startup rejects missing consent, consent other than Y, and a missing edition choice before launching the engine.
Required EULA and edition choices
- Read the Microsoft SQL Server EULA. Set
ACCEPT_EULA=Yyourself only if you accept it. - Set
MSSQL_PIDto the edition/product key you are entitled to use for this workload. Selecting an edition name does not establish ownership of a paid license. - If you select Developer, it is licensed for development and testing only, never production. Developer is a choice, not this template's forced/default edition.
- Production requires an eligible Express deployment within its limits or a properly licensed paid edition/product key. SQL Server 2022 Express has a 10 GB per-database limit. Evaluation is time-limited, not a permanent production license.
Review Microsoft's edition and licensing documentation before deployment or changing an existing instance's edition. The startup guard checks inputs, not your legal entitlement or production suitability.
Deploy and authenticate
- Make the two required choices above, attach
/var/opt/mssql, and allow memory aboveMSSQL_MEMORY_LIMIT_MB=2048; this engine setting is not the total container limit. - Deploy and wait for
SQL Server is ready for client connections. No HTTP endpoint/healthcheck is provided; TCP acceptance or RailwaySUCCESSis not SQL authentication proof. - Retrieve
MSSQL_SA_PASSWORDprivately from the service Variables tab. The initial login issa;MSSQL_USERNAMEdoes not create or rename a SQL login. - Connect with
sqlcmd, SSMS, or a TDS driver. Same-environment clients should use the private hostname and port 1433. External clients use the TCP proxy's actual hostname and assigned external port, not necessarily 1433. Remove the public proxy if unnecessary. - Create a disposable database/table, insert and select a unique marker, restart, reconnect, and select it again. Confirm a wrong-password connection is rejected and data/log files reside under the volume.
Real SQL queries, wrong-password rejection and restart-persistence checks remain requirements, not claimed passed tests. Runtime verification requires explicit EULA acceptance and an edition choice; no consent is implied by this listing.
Credentials, storage and TLS
The generated initial SA password uses a fixed complexity prefix plus a random alphanumeric suffix. Keep resolved credentials out of source control, logs and command-line history. MSSQL_URL and MSSQL_URL_PUBLIC are convenience URLs; ADO.NET, JDBC and other drivers may require separate host, port, login and password fields or their own connection-string syntax.
Changing MSSQL_SA_PASSWORD in Railway Variables is not reliable password rotation for an initialized volume. Rotate the stored SQL login through an authenticated ALTER LOGIN operation and update clients together. Applications should use dedicated least-privilege logins, not sa.
The mount holds system/user database data, log files and configuration. Keep one writer with no overlapping deployments. Startup retains trace flag -T1800; RAILWAY_RUN_UID=0 is a volume-permission compatibility tradeoff, not security hardening. Shared memory is configured to 256 MiB. Volumes are not SQL backups or high availability: configure and verify backups/restores separately.
Enable connection encryption. Trusting a self-signed certificate does not verify server identity; do not treat TrustServerCertificate=True as production TLS validation. Sensitive deployments need trusted certificates, validation, monitoring, resource planning and appropriate licensing.
Common Use Cases
- Integration tests or migration prototypes with an explicitly selected Developer edition.
- Evaluating SQL Server connectivity with your own eligible edition.
- A persistent SQL environment whose backup, restore and authentication behavior you validate.
Dependencies for Microsoft SQL Server 2022 Hosting
Explicit EULA consent, an eligible edition/license, an amd64 runtime, sufficient RAM, persistent storage and an authenticated SQL client. No paid Microsoft license is bundled.
Deployment Dependencies
- SQL Server 2022 editions.
- Microsoft licensing resources.
- SQL Server Linux containers.
- Official
mcr.microsoft.com/mssql/server:2022-CU26-ubuntu-22.04image, pinned by digest.
Why Deploy Microsoft SQL Server 2022 on Railway?
Railway provisions the container, private/public TCP connectivity and data volume. You retain responsibility for licensing, SQL access, trusted TLS, backups and verifying database behavior before relying on it.
Template Content
MSSQL_PID
Choose your licensed edition explicitly. Developer is development/test ONLY, never production. Production requires an eligible Express deployment or a properly licensed paid edition/product key; selecting a name does not grant a license.
ACCEPT_EULA
Required personal choice: read https://go.microsoft.com/fwlink/?LinkId=746388 and set Y only if you accept. No default acceptance.