In a world obsessed with **CI/CD** and full automation, sometimes the simplest method is the best for small projects: **manual deployment**. This hands-on process gives you total control, but it requires precision. Here are the core technical steps, including the essential commands, to get your web app live.
Phase 1: Secure Server Access
Security starts with locking down your remote server. We'll create a dedicated deployment user and use secure **SSH Keys** instead of passwords.
1. Create a Secure Deployment User (on Remote Server)
Always create a non-root user for deployments. The --disabled-password
flag ensures the user can only log in via a secure SSH key.
# 1. Create a new user with a disabled password
sudo adduser deployuser --disabled-password
# 2. Grant the user administrative rights
sudo usermod -aG sudo deployuser
# 3. Switch to the new user to continue setup
su - deployuser
2. Generate and Install the SSH Key
The SSH key is your secure ID card. It lets you connect to both the server and your Git provider without a password.
Task |
Command / Step |
Location |
Generate Key Pair |
ssh-keygen -t ed25519 -C "your_email@example.com" (Use the modern, secure ed25519 type) |
Local Machine |
Copy Public Key |
cat ~/.ssh/id_ed25519.pub |
Local Machine |
Add Key to Git Provider |
Paste the copied key into your Git provider's (GitHub/GitLab) Settings → SSH Keys. |
Web Browser |
Add Key to Remote Server |
Log in to the server, create the ~/.ssh/authorized_keys file, and paste your public key inside. This grants you access. |
Remote Server |
Phase 2: Deploying the Code
With secure access established, you can now clone your repository, build the assets, and get the application running.
3. Pull the Code and Install Dependencies (on Remote Server)
# Switch to the application directory (e.g., /var/www/app)
cd /var/www/app
# Clone your app using the secure SSH URL
git clone git@github.com:youruser/your-app.git .
# Install dependencies (example for Node.js)
npm install
# Build static assets (example for a front-end framework)
npm run build
4. Configuration and Launch (on Remote Server)
Finally, set up the server environment and launch the app. The specifics here depend on your application's technology.
- Environment Variables: Manually set any required secret keys or database connection strings.
- Web Server Setup: Configure Apache or Nginx to point to your application's build directory and handle the domain name.
- Restart the App: Restart the application's service to load the new code and configuration.
# Example: Restart a system service after deployment
sudo systemctl restart myapp.service
The Takeaway: Manual vs. Automated
Manual deployment is an excellent way to truly understand your server environment and is perfect for simple projects. However, keep in mind the trade-off: **control comes at the cost of time and reliability.** For anything complex or high-stakes, the risk of a simple missed command (a "human error") makes a shift to automation a necessity.