AWS Lightsail
AWS Lightsail
Main console:
https://us-east-2.console.aws.amazon.com/lightsail/webapp/home/instances
Docker containers: You purchase a Lightsail container service (serverless option) (that can hold up to 10 containers simultaneously). This is an additional and different purchase from the Lightsail server.
Next Steps:
- You create the Docker containers on your box.
- Then install AWS CLI (purpose is to push containers to the proper spot) using commands from AWS in your Powershell.
- Restart your Powershell (since only really loads things on startup)
- aws update
- aws --version (to check all happy. I saw aws-cli/2.36.31 Python/3.14.6 Windows/11 script-exe/AMD64 )
- docker images (to get REPOSITORY names and IMAGE names for all the docker images you want to push)
- download and install the AWS Lightsail EXE from https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-install-software.html
- aws configure (to give access key and secret key for the session) (from https://us-east-1.console.aws.amazon.com/iam?region=us-east-1#/security_credentials )
Push local Docker containers up:
Assumes you are in Powershell (Admin mode). So my docker ps was:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES4cdcbad990fc my-aspnet-api:local "dotnet CriticalView…" 21 hours ago Up 5 hours 0.0.0.0:5000->8080/tcp aspnet_backend_api
d7273173c187 my-react-ui:local "docker-entrypoint.s…" 47 hours ago Up 5 hours 0.0.0.0:5173->5173/tcp react_frontend_ui
87f30b10bfee mcr.microsoft.com/mssql/server:2025-latest "/opt/mssql/bin/laun…" 47 hours ago Up 5 hours (healthy) 0.0.0.0:1433->1433/tcp sql_server_dev
So my pushes were:
aws lightsail push-container-image --region us-east-2 --service-name container-service-1 --label my-aspnet-api --image my-aspnet-api:local
aws lightsail push-container-image --region us-east-2 --service-name container-service-1 --label my-react-ui --image my-react-ui:local
To push MSSQL, I had to change the tag first: docker tag mcr.microsoft.com/mssql/server:2025-latest my-mssql:local
but this worked:
aws lightsail push-container-image --region us-east-2 --service-name container-service-1 --label mssql-server --image my-mssql:local
However, MSSQL cannot run in the size AWS Lightsail container I have.
Lightsail Managed Database
Limitation: Lightsail Managed DB only supports MySQL and PostgreSQL, not MS SQL Server.
For checking statuses of the multiple containers:
aws lightsail get-container-images --service-name container-service-1
For checking state of current deployment:
aws lightsail get-container-services --service-name container-service-1 --query "containerServices[0].{state:state,version:currentDeployment.version}"
Important Links
UI: https://us-east-2.console.aws.amazon.com/lightsail/webapp/home/instances
Command Line of My AWS Lightsail: https://us-east-2.console.aws.amazon.com/lightsail/remote/us-east-2/instances/Amazon_Linux_2023-1/terminal?protocol=ssh
Pushing Containers: https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-pushing-container-images.html
Credentials: https://us-east-1.console.aws.amazon.com/iam?region=us-east-1#/security_credentials
Gotchas
Lightsail has no equivalent to Compose's depends_on to sequence container startup.
Lightsail runs all containers in one deployment inside a shared network namespace (like a Kubernetes pod), so they talk to each other via localhost:<port>, not per-container DNS names the way Docker Compose works.
In Lightsail, READY specifically means the service has no active deployment right now, while RUNNING means an active deployment is actually serving traffic.
Lightsail Container Service gives one deployment exactly one public endpoint — one container, one URL, for the whole service. So this creates problems with container-service-1 having backend_api and frontend_ui both in it.
Latest (as in backend-api.LATEST) isn't a valid Lightsail image version token, since Lightsail only allows real numeric versions.
Comments
Post a Comment