A repeatable Git-to-server deployment workflow reduces avoidable production mistakes. This guide provides a practical release checklist for small web projects, covering SSH access, branches, environment variables, dependencies, database changes, file permissions, smoke tests, monitoring, and rollback preparation.
Overview
Deploying directly from a Git repository to web hosting can be simple, but the process still needs controls. A successful deployment is more than copying the latest files: the server must run the expected application version, receive the correct configuration, preserve sensitive values, apply compatible database changes, and remain recoverable if something fails.
The workflow below assumes a small project hosted on a VPS, cloud instance, managed developer platform, or hosting account with SSH access. The exact commands depend on the operating system, runtime, framework, package manager, and hosting control panel. Confirm the provider’s documentation before changing services, restarting processes, or modifying permissions.
Keep production separate from development. Use a dedicated deployment branch or a clearly defined protected branch, and make each release identifiable with a commit hash or Git tag. If the project has a staging environment, test the same build and configuration pattern there first. A staging environment is especially useful for framework upgrades, dependency changes, and database migrations.
What to track
1. The release identity
Before deploying, record the commit or tag being released. Check the working tree locally and confirm that the intended branch contains the expected changes:
git status
git log -1 --oneline
git rev-parse --short HEADDo not deploy uncommitted local edits. A release record should also note the application version, deployment time, person or process that initiated it, and any special migration or configuration steps.
2. SSH access and server scope
Use an individual SSH key or a restricted deployment key rather than sharing a password. Store private keys outside the repository, protect them with an appropriate passphrase where practical, and remove access that is no longer needed. Confirm that the key connects to the intended host and account before running deployment commands.
Prefer a limited server user for routine releases. Avoid performing normal application operations as root. Verify the target path, active virtual host, runtime version, and process manager so that files are not deployed to the wrong site or service.
3. Environment variables and secrets
Keep secrets such as database passwords, API tokens, application keys, and mail credentials outside Git. Production configuration may be stored in the hosting control panel, a protected environment file, or a secrets manager, depending on the platform. Check that required variables exist without printing their values to logs or terminal history.
Maintain a documented list of required variable names and safe example values. This makes missing configuration easier to identify while keeping credentials private. Treat environment changes as releases: record what changed, who approved it, and whether a service restart is required.
4. Dependencies and runtime versions
Track the language runtime and package-manager versions used by production. Use the project’s lockfile when the package manager supports one, and install production dependencies using the project’s documented command. Examples include npm ci, composer install --no-dev --prefer-dist, or the equivalent command for the application’s ecosystem. Do not substitute commands without checking how the project manages locked versions and build scripts.
Build assets in a controlled environment when possible, then deploy the generated output with the release. If the server builds assets, verify that the required compiler, memory limit, and runtime tools are available.
5. Database changes
Review migrations before applying them. Take a verified backup according to the project’s recovery plan, and understand whether the migration is backward-compatible with the currently running application. A safe sequence often involves deploying code that can work with both the old and new schema, applying the migration, and then enabling code that depends on the new structure.
Never assume that a database rollback is as simple as reverting a Git commit. Some schema changes destroy or transform data. Keep a separate database restore plan and test restoration periodically; the website backup and restore checklist can help organize this work.
6. Permissions, processes, and health checks
Application files should be readable by the web or application user, while writable directories should be limited to locations that genuinely need writes, such as cache, upload, or log directories. Avoid broad permissions such as making the entire project writable by everyone.
Track the service that runs the application, such as a web server, process manager, queue worker, or scheduled task. Know how to restart or reload it safely, and confirm that its configuration points to the current release. A deployment is incomplete until the application responds correctly and its logs show no new startup or permission errors.
Cadence and checkpoints
Use the same checkpoints for every release, even when the change appears small. A compact release sequence is:
- Prepare: review the diff, confirm tests pass, identify the release commit, and check open issues or planned maintenance.
- Back up: verify the latest usable website and database backup before changes begin.
- Connect: authenticate with the intended SSH key and confirm the target host and application path.
- Preserve: keep the current release available or create a server-side backup so the previous version can be restored.
- Deploy: fetch the approved commit, install locked production dependencies, and build assets using documented versions.
- Configure: confirm environment variables, file ownership, writable directories, scheduled tasks, and queue settings.
- Migrate: apply database changes only after reviewing compatibility and confirming the backup.
- Reload: restart or reload the relevant services when required, then inspect application and web-server logs.
- Test: run smoke tests for the homepage, authentication, a key form, database reads and writes, uploads, email-triggering actions, and any critical API endpoint.
- Record: note the deployed commit, migration result, test outcome, observed warnings, and rollback decision.
For frequent releases, automate repeatable steps with a deployment script or CI/CD pipeline. Keep destructive operations, production approval, and secret access behind explicit controls. Automation should make the checklist more consistent, not hide what it does.
After deployment, watch uptime and application behavior rather than relying only on a successful command. A guide to website uptime monitoring and outage response can help define alerting and escalation steps.
How to interpret changes
Not every deployment issue points to the same cause. A blank page or server error immediately after release often suggests a runtime exception, missing environment variable, incompatible dependency, or incorrect permissions. A slow request may indicate a database query, cache problem, resource limit, or background worker that did not restart. A failed asset request may result from an incorrect build path, stale cache, or incomplete upload.
Compare the new release with the previous known-good version. Check the commit, runtime, dependency lockfile, environment configuration, service status, and logs in that order. This narrows the search without making several unrelated changes at once.
Rollback when the impact is material, the cause is not quickly understood, or the release cannot meet its acceptance checks. A rollback plan should specify the previous commit, how to restore application files, whether services must be reloaded, and how to handle database changes. If a migration is not safely reversible, restore from backup only after assessing data loss and coordinating the recovery decision.
Track recurring signals across releases: failed smoke tests, deployment duration, error-log volume, response time, disk usage, queue depth, backup status, and resource pressure. These trends can reveal a gradual hosting or application problem before it becomes an outage. For broader performance work, use a website hosting speed checklist alongside release records.
When to revisit
Use this workflow for every production release, configuration change, dependency update, and framework upgrade. Review the checklist monthly or quarterly even if releases are infrequent. Confirm that SSH keys are still appropriate, inactive access has been removed, runtime and package-manager versions remain supported by the project, backups can be restored, and the documented rollback path still matches the server.
Update the deployment notes whenever the hosting provider changes its control panel, SSH rules, process manager, backup system, or server image. Recheck commands after major Git, language, framework, package-manager, or deployment-tool updates. Also revisit the process after an outage, failed migration, security event, or move to new hosting control panel.
For your next release, copy this short checklist into the change record: approved commit; tested backup; confirmed SSH target; verified secrets; locked dependencies; reviewed migration; checked permissions; completed smoke tests; inspected logs; recorded rollback status. Completing those checks consistently turns Git deployment to a server from an improvised task into a controlled operating routine.