Alibaba Cloud consumption vouchers How to Deploy Alibaba Cloud Web Hosting
Overview: What “Web Hosting” Means on Alibaba Cloud
Deploying web hosting on Alibaba Cloud sounds complex at first because there are many services, optional components, and a few different architectures you can choose from. But the core idea is simple: you need a place to run your website (or serve static files), a way to reach it over the internet (domain and traffic), and some basic operational settings (security, logs, scaling, and monitoring).
In most real projects, you’ll choose one of these common routes:
- Static hosting: Your site is mostly HTML/CSS/JavaScript (and images). You deploy files and let the cloud serve them fast.
- Application hosting: Your site is a backend app (Node.js, Java/Spring, PHP, Python, etc.). You run code on a compute service and expose it as a web service.
- Hybrid: Static assets are served from a fast CDN, while dynamic requests go to an application server.
This guide focuses on practical deployment steps you can follow. I’ll explain the typical options, what to configure, and what to check when things don’t work.
Alibaba Cloud consumption vouchers Step 1: Decide Your Deployment Model (Static vs. App)
Before touching any console settings, decide what kind of website you’re deploying. This decision determines which Alibaba Cloud services you should use and how the traffic flows.
Static site checklist
- Your website can be built into a folder of files (for example:
index.html,main.js,style.css, assets). - No server-side logic is required for every request.
- If you need HTTPS, you still configure domain and certificates, but your “hosting” is mostly file delivery.
Static hosting often pairs well with CDN (Content Delivery Network) to reduce latency and improve speed globally.
Application site checklist
- You have a backend that responds dynamically.
- You need environment variables, databases, authentication, or server-side rendering.
- You manage runtime processes (or use a platform that manages them for you).
For applications, you’ll typically set up a compute environment (for example, ECS), configure a web server/proxy, open ports, and then optionally place a CDN in front.
Step 2: Set Up Core Accounts and Region
Almost every deployment involves these baseline steps.
Create or verify your Alibaba Cloud account
Ensure you have an account that can access the console and create resources. Verify your identity if required, and enable any required permissions.
Choose the right region
Pick a region close to your users or close to your other dependencies (like databases). Region choice affects latency and sometimes pricing.
A good starting rule: if most of your users are in East Asia, choose a region in that area. If you’re already using databases or storage in a region, deploy compute in the same region to reduce cross-region overhead.
Alibaba Cloud consumption vouchers Step 3: Use the Right Hosting Service
Alibaba Cloud offers multiple ways to host web content and applications. The best choice depends on your workload and operational preferences.
Option A: Static website hosting (File delivery)
For a static site, the usual flow is:
- Upload your build output to an object storage service (files stored securely).
- Configure a bucket to serve as a website origin.
- Attach a CDN to speed up delivery and enable HTTPS.
This model is cheap and stable because you’re not running servers for each request.
Option B: ECS-based application hosting (Full control)
For dynamic apps, many teams use ECS (Elastic Compute Service) for full control:
- Create an ECS instance.
- Install and configure runtime (Node.js/Java/Python) and a web server or reverse proxy (Nginx is common).
- Deploy your application.
- Open security group ports and configure firewall rules.
- Map a domain to the instance or use a load balancer for better scalability.
This approach gives you control, but you also take responsibility for patching and process management.
Option C: Managed compute (Less operational work)
If you prefer less manual server management, consider managed platforms that run your code with fewer concerns about operating systems. The exact service names differ over time, but the principle stays the same: you deploy code, configure runtime settings, and the platform handles scaling and updates more automatically.
If you’re new or you want speed, managed options are often the quickest path.
Step 4: Domain Name and DNS Setup
Even if your hosting is ready, users won’t reach it reliably without correct domain and DNS settings.
Buy or bring your domain
You can use a new domain or connect an existing one. Make sure you have control of DNS records (either in Alibaba Cloud DNS or your current DNS provider).
Map the domain to your hosting endpoint
You’ll typically set either:
- A record to point a subdomain (like
www) directly to an IP (common for ECS). - CNAME to point a subdomain to another hostname (common for CDN endpoints).
- Alias/ALIAS (if supported) to map to a load balancer or CDN without managing IPs.
Common mistake: pointing the domain to the wrong target (for example, an origin instead of the CDN). Your goal is that traffic reaches the front door that can handle HTTPS and correct routing.
Step 5: Configure HTTPS (SSL/TLS)
HTTPS is now expected for almost any modern website. Besides trust, it also affects browser behavior and search engine preferences.
Choose where SSL terminates
There are two common models:
- At the CDN/load balancer: HTTPS is handled at the edge. Your origin might still communicate via HTTP or HTTPS depending on configuration.
- At the server: ECS (or your application runtime) terminates HTTPS directly. This increases operational work and certificate management.
For most teams, terminating at CDN/load balancer is simpler.
Install or bind certificates
When you bind a certificate to your domain, pay attention to:
- The certificate covers the domain (including wildcard vs exact domain).
- The certificate status is “issued” and active.
- DNS records are correct so domain validation succeeds.
If HTTPS fails, it’s often a mismatch between the certificate and domain, or the DNS is pointing traffic somewhere else.
Step 6: Deploy a Static Website (Concrete Example)
Let’s walk through a typical static deployment workflow using object storage plus CDN. Even if the exact console wording changes, the concepts stay the same.
Build your website locally
Start by generating the production build. For example, if you use a front-end framework (React/Vue/Angular), build output usually goes into a folder like dist or build.
Make sure your build folder contains an index.html. This file is essential because web servers and CDNs need a default entry point.
Upload build files to object storage
- Create a storage bucket.
- Choose an appropriate storage class if your site is public and needs frequent delivery.
- Upload the entire build folder contents into the bucket.
Also set basic access rules so your content can be served through your CDN. Some setups keep objects private and rely on CDN authorization.
Configure website index and error pages
If you use single-page application routing (SPA), you might want 404 requests to return index.html so the front-end router can handle it. Many CDNs and static hosting systems support “custom error response” mappings.
Without this, refreshing routes like /about may return a 404 even though navigation within the app works.
Create the CDN distribution
When setting up CDN:
- Set the origin to your object storage endpoint.
- Enable HTTPS using your domain and certificate.
- Configure cache rules (for example: cache static assets longer than HTML).
After activation, your CDN will provide a new endpoint hostname. You then map your domain DNS records to the CDN.
Verify deployment end to end
Before celebrating, verify systematically:
- Open
https://yourdomain.com/and confirm the main page loads. - Open static assets like
main.jsandstyle.cssand confirm they return 200. - Test a deep link route if it’s an SPA.
- Check browser console for 404/blocked mixed content issues.
One more common issue: if you update files but users still see old content, it’s usually CDN cache. You may need cache invalidation or versioned asset filenames.
Step 7: Deploy a Web Application on ECS (Concrete Example)
Now let’s look at a typical deployment for a backend app. The exact stack varies, but the operational steps are consistent.
Create an ECS instance
- Select an operating system image.
- Pick a size that matches your traffic and resource needs.
- Alibaba Cloud consumption vouchers Enable network access carefully.
During creation, pay attention to whether the instance gets a public IP or whether you plan to use a load balancer. Simplicity often starts with a public IP, but for production it’s more common to use a load balancer and keep the backend more restricted.
Set up security group rules
Alibaba Cloud consumption vouchers Alibaba Cloud security groups act like a firewall layer. Common rules:
- Allow SSH (port 22) only from your IP range, not from everywhere.
- Allow HTTP (port 80) and HTTPS (port 443) from anywhere (if you terminate at the server) or from the load balancer/CDN.
- Allow your application port (for example 3000, 8080, or 8000) only from trusted sources (like Nginx on the same host or load balancer).
Overly open rules are a security risk. Start tight, then adjust when you confirm traffic paths.
Install a reverse proxy (Nginx) and configure routing
A reverse proxy helps with:
- Serving static files efficiently.
- Forwarding requests to your application.
- Centralizing HTTPS termination if you choose server-side TLS.
Your basic Nginx flow is: accept requests on port 80/443, then proxy pass to your app listening on an internal port.
Deploy your application
Alibaba Cloud consumption vouchers Choose a deployment method that matches your workflow:
- Copy files and run a process manager.
- Build from a repository on the instance.
- Use containers if your application is containerized.
For long-running apps, use a process manager so the service restarts after reboot or failure. Also make sure you can read logs to debug issues.
Configure environment variables and secrets
Applications typically need database URLs, API keys, and environment flags. Store these securely using Alibaba Cloud secret management (if available in your setup), or environment variables managed carefully on the server.
Avoid hardcoding secrets in your code repository.
Test locally first, then from outside
Testing order that saves time:
- Test the app on the instance locally (for example,
curltolocalhost). - Test from the instance using the public domain/IP.
- Test from your laptop/browser to confirm security groups and routing work.
Step 8: Add a Load Balancer for Production Readiness
When traffic grows or you need high availability, a load balancer becomes the safer foundation. Instead of routing directly to a single ECS instance, you route to a load balancer that can distribute requests across multiple backend instances.
Benefits
- Health checks and automatic failover.
- Better scalability: add more instances without changing DNS.
- Alibaba Cloud consumption vouchers Centralized TLS termination if configured.
Basic setup concept
Alibaba Cloud consumption vouchers You configure:
- Frontend listener (HTTP/HTTPS).
- Backend target group (ECS instances).
- Health check path and thresholds.
Then you map your domain DNS to the load balancer (or to a CDN that points to the load balancer).
Step 9: Observability and Logging (Don’t Skip This)
Deployment is not finished when the page loads once. You need visibility to maintain the site and respond to issues.
Application logs
Record request logs and application errors. Ensure you can see:
- Response status codes (200/404/500)
- Latency and slow requests
- Stack traces and exceptions
Web server and proxy logs
If you use Nginx, check Nginx logs for:
- Upstream timeouts
- Bad gateway errors
- Alibaba Cloud consumption vouchers SSL handshake problems
Monitoring and alerting
Set alerts for:
- Instance CPU/memory pressure
- Healthy/unhealthy backend counts
- Traffic spikes and abnormal error rates
This reduces the time from “something is wrong” to “we know why.”
Step 10: Troubleshooting Guide (Most Common Failures)
When your site doesn’t work, the fix is usually straightforward if you diagnose in the right order.
1) Domain points to the wrong place
Symptoms:
- DNS resolves, but you get the wrong site.
- HTTPS certificate errors mention unexpected domains.
Alibaba Cloud consumption vouchers Fix:
- Confirm DNS records: A/CNAME/ALIAS target should match your intended entry point (CDN or load balancer).
- Wait for DNS propagation if you changed records recently.
2) CDN cache serves old content
Symptoms:
- You deployed a new version, but users still see the old one.
Fix:
- Invalidate or refresh CDN cache for updated paths.
- Use cache-friendly versioning for static assets (e.g., hashed filenames).
3) 404 on direct links (SPA routing)
Symptoms:
- Alibaba Cloud consumption vouchers Homepage works, but
/some/routereturns 404 on refresh.
Fix:
- Configure “error page rewrite” or “fallback to index.html” for 404 responses.
4) Connection refused / timeouts to backend
Symptoms:
- Nginx shows upstream timeout or 502 Bad Gateway.
Fix:
- Check application is listening on the expected port.
- Verify security group rules allow traffic from the proxy/load balancer.
- Confirm process is running (and not crashed).
5) HTTPS handshake failures
Symptoms:
- Browser says certificate is invalid, not matching domain, or handshake fails.
Fix:
- Certificate covers your domain.
- Alibaba Cloud consumption vouchers Domain DNS points to the correct endpoint.
- Alibaba Cloud consumption vouchers If you’re terminating TLS on server, confirm Nginx/port configuration.
Step 11: Security and Best Practices
Web hosting isn’t only about “getting it online.” It’s also about reducing the chance of incidents.
Use least privilege in security groups
Only open ports you need. Restrict SSH to your own IP range. For public services, allow only HTTP/HTTPS, and block direct access to internal application ports.
Keep systems updated
Patch operating systems and runtime dependencies. Many security issues come from unpatched servers or libraries.
Protect sensitive endpoints
For admin pages or APIs, implement authentication and rate limiting. If you’re using a CDN or load balancer, consider WAF-style protections if available in your plan.
Manage secrets safely
Don’t put database passwords in code repositories. Prefer secret storage mechanisms or at least secure environment variable handling with restricted access.
Step 12: A Recommended Deployment Path (For Most Teams)
If you want a practical starting point that balances speed and reliability, follow this path:
- Static front-end: Upload build files to object storage, serve with CDN, enable HTTPS.
- Dynamic backend: Deploy to ECS (or managed compute), place Nginx as a reverse proxy, verify logs and health.
- Production traffic: Add a load balancer and optionally a CDN in front for caching and edge TLS.
- Operations: Configure monitoring, logging, and alerting before you go live.
This approach scales naturally: you can start simple for testing, then grow into load balancing and stronger security without rewriting everything.
Wrap-Up: How to Know You’re Done
You can say deployment is “done” when these conditions are true:
- Your domain resolves correctly to the intended entry point.
- HTTPS works without warnings.
- Key pages load reliably, including deep links (for SPAs).
- Your application responds correctly under normal traffic.
- You can debug issues using logs and metrics.
- Alibaba Cloud consumption vouchers Security groups and firewall rules follow least-privilege principles.
If you build this checklist into your workflow, deploying web hosting on Alibaba Cloud becomes a repeatable process rather than a one-time scramble.

