Deploy Solid Start on AWS
Deploy your Solid Start applications to AWS using Thunder patterns. This guide covers server-side rendering deployments with ECS Fargate and Application Load Balancer.
Solid Start applications are deployed using the Web Service pattern, which provides full-stack SSR capabilities with managed containerization.
Deploy server-side rendered Solid Start applications using ECS Fargate and Application Load Balancer with the CDK-WebService library.
Create Project
npm create solid@latest my-solid-appcd my-solid-apppnpm create solid my-solid-appcd my-solid-appbun create solid my-solid-appcd my-solid-appInstall Dependencies and Setup Stack
npm i tsx @thunderso/cdk-webservice --save-devpnpm add -D tsx @thunderso/cdk-webservicebun add -d tsx @thunderso/cdk-webserviceimport { Cdk, WebServiceStack, type WebServiceProps } from "@thunderso/cdk-webservice";
const svcProps: WebServiceProps = { env: { account: 'your-account-id', region: 'us-west-2' }, application: 'your-application-id', service: 'your-service-id', environment: 'production',
rootDir: '', // e.g. 'app/' for monorepos};
new WebServiceStack( new Cdk.App(), `${svcProps.application}-${svcProps.service}-${svcProps.environment}-stack`, svcProps);Build Settings Using Nixpacks
Configure automatic containerization with Nixpacks:
const svcProps: WebServiceProps = { // ... other props
buildProps: { buildSystem: 'Nixpacks', installcmd: 'npm install', buildcmd: 'npm run build', startcmd: 'npm run start', },};Build Settings Using Docker Container
Alternatively, use a custom Dockerfile:
FROM public.ecr.aws/docker/library/node:20-alpine
# Copy code and install dependenciesWORKDIR /appCOPY . .RUN npm installRUN npm run build
EXPOSE 3000CMD ["npm", "run", "start"]const svcProps: WebServiceProps = { // ... other props
serviceProps: { dockerFile: 'Dockerfile', port: 3000, },};Environment Variables and Secrets for SSR
Configure runtime environment variables and secrets:
const svcProps: WebServiceProps = { // ... other props
serviceProps: { variables: [ { NODE_ENV: 'production' }, { PUBLIC_API_URL: 'https://api.example.com' } ], secrets: [ { key: 'DATABASE_URL', resource: 'arn:aws:secretsmanager:us-west-2:123456789012:secret:/my-app/DATABASE_URL-abc123' }, ], },};Deploy
Build and deploy your containerized application:
npm run buildnpx cdk deploy --all --app="npx tsx stack/index.ts"pnpm run buildpnpm exec cdk deploy --all --app="pnpm exec tsx stack/index.ts"bun run buildnpx cdk deploy --all --app="bunx tsx stack/index.ts"After deployment, you’ll receive an Application Load Balancer URL to access your SSR application.
For complete documentation, see the CDK-WebService README.