Deploying Your Own Website to a Cloud Server: A Complete Practical Guide

    A step-by-step guide to deploying a self-developed website on a cloud server, covering instance sizing, images, security groups, file transfer, database setup, process management, and post-launch checks—so you end up with a minimal, verifiable deployment you can repeat and rebuild.

    Deploying a self-developed website to a cloud server is not simply “buy a machine and upload a zip file.” It means rebuilding, on a remote host that only has a command line, everything your development environment took for granted: the runtime, the ports, the accounts, and the data—and then making it accessible from the public internet in the way you intend. This guide follows the real order of going live, assuming you already have a working website application, with the goal of producing a minimal, reviewable deployment.

    1. Define the Runtime Boundaries First

    Before going live, write down four things on a single page: which processes make up your website (page service, API service, database, static assets); which ports each one listens on; which directories must be writable (uploads, logs, temp files); and which configuration values change per environment (database address, credentials, secrets, domain names). Without this checklist, every later step becomes trial and error.

    For learning or validation, there is no need to aim for high-spec hardware. Prefer pay-as-you-go or short-term instances that can be released at any time, sized so they can “stably run the business”: memory must cover the application process plus the database running simultaneously, and the system disk should leave room for logs and installation packages. Estimate bandwidth and traffic based on expected visits—a demo site is usually far below production peak. If you use a public cloud computing service such as Baidu AI Cloud, the instance, image, security group, and public IP in the console are all part of the same chain—verify them together at purchase time rather than patching things afterward.

    There are three common mistakes in instance sizing. First, sorting by price only and ignoring pre-selected bandwidth, disk, and billing cycles, which results in “looks cheap, costs more at settlement.” Second, choosing a region too far from your main users, then misreading the resulting latency as an application performance problem. Third, putting production and practice workloads on the same machine, so one mistake affects both. A practice environment should be disposable and rebuildable.

    2. Images, Accounts, and Security Groups

    The image determines the initial system. Website services mostly run on command-line server systems, not desktop systems. Choose an officially maintained image whose version is still within its support window, note the major version number, and install all dependencies against that version. Don’t install desktop components just because the interface feels familiar—they consume extra resources and expand the attack surface.

    A security group is a network filter in front of the instance, not an application-level login check. The principle is default deny, allow as needed: open the remote management port only to your fixed egress address; open website ports to the networks that need access; keep database ports closed to the public internet by default, allowing only localhost or specified internal networks. When adding rules, specify the protocol and port explicitly—avoid “all protocols, all sources” rules created for convenience during practice and forgotten at launch. After changing a security group, verify with your local browser or a simple connectivity check whether the block is at the network layer or the process simply isn’t listening.

    Don’t use the highest-privilege account for day-to-day work. You can use the admin account for initial setup, then create dedicated accounts for the application and file transfers, granting only the permissions needed for the website directory and its runtime. Passwords should be sufficiently random; prefer key-based login where possible. If password login is kept, make sure empty passwords and weak credentials are disabled.

    3. Connect to the Host and Get Comfortable with the Command Line

    After purchase, confirm in the console that the instance is running and a public IP has been assigned. Connect using a client that supports encrypted remote login rather than exposing the management port in plaintext. On first login, verify that the host fingerprint matches what the console shows to avoid connecting to the wrong address.

    What you see on the server is a command line, not a desktop. You only need a small set of skills: checking the current directory and disk usage, changing directories, viewing processes and listening ports, reading the tail of logs, and starting/stopping services with the system service manager. Use the built-in text editor for configuration changes. The key habit is: back up before editing, check syntax after editing, then restart the relevant process. Never experiment directly on the only copy of a config file.

    Keep a deployment note with every successful command and configuration snippet, including: working directory, run user, environment variables, and listening ports. Notes are more reliable than memory, and they can be reused directly when rebuilding an instance.

    4. Transfer the Application and Static Files

    You need a controlled file channel between your development machine and the server. Common approaches are the system’s built-in file transfer service or encrypted remote copy. Either way, handle four things separately:

    • User: Never transfer files with the highest-privilege account. Create a dedicated transfer user whose home directory or authorized directory points to the website’s release directory.
    • Permissions: The website process’s run user must be able to read the application and config files, and write to the upload and log directories; other users must not be able to read configs containing credentials. Overly broad permissions are a common cause of data leaks; overly narrow ones show up as startup failures or unwritable logs. Troubleshoot against the process’s actual user rather than blindly opening the whole disk.
    • Port: Include the file transfer port in the security group with source restrictions as well; once verification is done and the service isn’t needed permanently, stop the service or revoke the rule.
    • Client and paths: Be clear locally whether you’re uploading build artifacts or source code. For an already-built website, upload the runnable package and static assets—don’t include local dependency caches, version-control directories, or local keys. After uploading, verify file sizes, timestamps, and directory structure on the server, so you don’t assume a successful release when the files actually landed in the wrong path.

    5. Database and Application Process

    Most dynamic websites need more than page files—they need a database. Install the database in a location consistent with your security policy: same machine as the website is fine for practice, but production is better served by a separate instance with network restrictions. At minimum, complete these steps after installation: listen only on necessary addresses, create the business database and a dedicated account, grant that account only the permissions it needs on that database, disable default passwords left by the installer, and align character set and time zone with your development environment. Put connection details into the server-side configuration—never hard-code them into the repository and commit.

    Run a real connection test from the website’s machine using a database client, confirming it’s not a case of “works against my local dev database, fails against the server database.” Prepare a minimal schema script and a re-importable set of initial data to make rebuilding on a new machine easy.

    Install the runtime and dependencies matching your tech stack, keeping versions consistent with development and testing. Take a typical Java website as an example: you need the runtime plus a service process to host the web application. Place the deployable package in the agreed directory, point the configuration to the database you prepared, and set appropriate memory parameters so a small instance isn’t overwhelmed at startup. The process should be managed by the system service manager so it starts on boot and restarts after abnormal exits—not left in a login session that disappears when you log out.

    Recommended startup order: database first, then the application; only after the application is listening should you open the website port in the security group. This separates “process didn’t start” from “network not allowed.”

    6. Release Checks and Minimal Operations

    Access the public URL in a browser and cover the homepage, login, one write operation, and one read operation. Check the application logs and the database for corresponding records. Verify that error pages don’t leak stack traces or paths. Confirm that upload, download, or export functions have correct directory permissions.

    Right after going live, do three small things. First, keep an offline backup of both the configuration and the database—don’t leave backups only on the same system disk. Second, set up log rotation to prevent the disk from filling up and taking the service down. Third, document the rollback procedure: where the previous package is stored and how to stop the new version and start the old one. A release without a rollback plan isn’t finished.

    If traffic or availability requirements grow later, consider load distribution, object storage for static assets, a dedicated database, and monitoring with alerting. These are all general-purpose capabilities that should be introduced only after the single-server path works—avoid stacking components from day one and then being unable to locate failures.

    Finally, turn the steps above into a fixed checklist: choose instance size and image, tighten the security group, create dedicated accounts, upload build artifacts, initialize the database, trial-run the application in the foreground, convert it to a system service, and run functional and backup checks. Run through the checklist twice, and you’ll no longer depend on one-off manual memory—you’ll have the ability to migrate or rebuild the same website on a new instance whenever needed.