This Makefile provides convenient shortcuts for all installation commands in the dotfiles_server project. Instead of typing long commands, you can use simple make commands.
# Show all available commands
make help
# Show quick shortcuts
make shortcuts# Make scripts executable
make install
# Verify setup
make verifymake update| Command | Description | Example |
|---|---|---|
make setup |
Setup the server | make setup |
make ssh-port PORT=XXXX |
Change SSH port | make ssh-port PORT=19742 |
make ssh-timeout |
Configure SSH timeout | make ssh-timeout |
Shortcuts: make s, make sp PORT=XXXX, make st
| Command | Description | Example |
|---|---|---|
make php |
Install PHP | make php |
make php-ext VER=X.X |
Install PHP extensions | make php-ext VER=8.4 |
make lazydocker |
Install lazydocker | make lazydocker |
Shortcuts: make p, make pe VER=8.4, make ld
| Command | Description | Example |
|---|---|---|
make global-dev |
Setup NVM, NPM, Yarn, ZSH globally | make global-dev |
make global-dev-force |
Force update for all users | make global-dev-force |
make add-user USER=name |
Add user to developers group | make add-user USER=john |
make add-user-all |
Add all users to group | make add-user-all |
Shortcuts: make gd, make gdf, make au USER=john, make aua
| Command | Description | Example |
|---|---|---|
make zabbix-server |
Install Zabbix Server | make zabbix-server |
make zabbix-client IP=X.X.X.X |
Install Zabbix Agent | make zabbix-client IP=192.168.1.100 |
make update-zabbix-ip IP=X.X.X.X |
Update Zabbix Server IP | make update-zabbix-ip IP=192.168.1.200 |
Shortcuts: make zs, make zc IP=192.168.1.100, make uzi IP=192.168.1.200
| Command | Description | Example |
|---|---|---|
make fix-mysql |
Fix MySQL frozen issue | make fix-mysql |
Shortcuts: make fm
# 1. First time setup
make install
# 2. Setup server
make setup
# 3. Configure SSH timeout
make ssh-timeout
# 4. Change SSH port
make ssh-port PORT=19742# Install global dev tools
make global-dev
# Add current user to developers group (already done by global-dev)
# Add additional users
make add-user USER=john
make add-user USER=mary
# Or add all users at once
make add-user-all
# Force update all existing users
make global-dev-force# Install PHP
make php
# Install PHP 8.4 extensions
make php-ext VER=8.4
# Install lazydocker
make lazydocker# On monitoring server
make zabbix-server
# On client servers (method 1: interactive)
make zabbix-client
# On client servers (method 2: direct)
make zabbix-client IP=192.168.1.100
# Update Zabbix Server IP on existing clients
make update-zabbix-ip IP=192.168.1.200# Setup
make s # instead of: make setup
# SSH
make sp PORT=19742 # instead of: make ssh-port PORT=19742
make st # instead of: make ssh-timeout
# PHP
make p # instead of: make php
make pe VER=8.4 # instead of: make php-ext VER=8.4
# Dev environment
make gd # instead of: make global-dev
make gdf # instead of: make global-dev-force
make au USER=john # instead of: make add-user USER=john
# Zabbix
make zs # instead of: make zabbix-server
make zc IP=192.168.1.100 # instead of: make zabbix-client IP=192.168.1.100
make uzi IP=192.168.1.200 # instead of: make update-zabbix-ip IP=192.168.1.200
# Database
make fm # instead of: make fix-mysql# Verify installation
make verify
# Test SSH configuration
make test-ssh
# Test Zabbix Agent
make test-zabbix
# Test NVM installation
make test-nvm
# Run all tests
make test-all# Show repository info
make info
# Show available shortcuts
make shortcuts
# Show help
make help# Update from git
make update
# Clean old backups (older than 30 days)
make clean# Setup server, install PHP, and global dev tools
make setup && make php && make global-dev
# Install Zabbix client and update IP
make zabbix-client IP=192.168.1.100 && make update-zabbix-ip IP=192.168.1.200You can pass variables to make commands:
# SSH port
make ssh-port PORT=19742
# PHP version
make php-ext VER=8.4
# Username
make add-user USER=john
# IP address
make zabbix-client IP=192.168.1.100
make update-zabbix-ip IP=192.168.1.200# Add multiple users one by one
make add-user USER=john
make add-user USER=mary
make add-user USER=bob
# Or add all users at once
make add-user-all| Task | Direct Script | Makefile |
|---|---|---|
| Setup | bash install.sh setup |
make setup or make s |
| Change SSH port | bash install.sh ssh_port 19742 |
make ssh-port PORT=19742 or make sp PORT=19742 |
| Install PHP ext | bash install.sh php_extension 8.4 |
make php-ext VER=8.4 or make pe VER=8.4 |
| Global dev | sudo bash install.sh global_dev |
make global-dev or make gd |
| Add user | sudo bash install.sh add_dev_user john |
make add-user USER=john or make au USER=john |
| Zabbix client | sudo bash install.sh zabbix_client 192.168.1.100 |
make zabbix-client IP=192.168.1.100 or make zc IP=192.168.1.100 |
| Update Zabbix IP | sudo bash install.sh update_zabbix_ip 192.168.1.200 |
make update-zabbix-ip IP=192.168.1.200 or make uzi IP=192.168.1.200 |
✅ Shorter commands - Less typing ✅ Easy to remember - Consistent naming ✅ Tab completion - Works with shell completion ✅ Self-documenting - Built-in help system ✅ Error checking - Validates parameters ✅ Shortcuts - Even shorter aliases ✅ Utility functions - Testing, verification, cleanup
If make is not installed:
# Ubuntu/Debian
sudo apt-get install make
# CentOS/RHEL
sudo yum install makeSome commands require sudo. Makefile handles this automatically, but ensure you have sudo access:
# Check sudo access
sudo -vIf you forget to set a required variable:
# This will show an error
make add-user
# Correct usage
make add-user USER=johnAdd -n flag to see what would be executed without running:
make -n setup
make -n ssh-port PORT=19742make <TAB> # Shows all available targets
make ssh-<TAB> # Shows ssh-related targets# Dry run - see what will be executed
make -n setup
make -n global-dev# Use && to chain commands
make setup && make global-dev && make lazydockerCreate aliases in your .bashrc or .zshrc:
alias mgs='make global-dev'
alias mau='make add-user USER='
alias mzc='make zabbix-client IP='All commands have short versions:
s= setupsp= ssh-portst= ssh-timeoutgd= global-devzc= zabbix-client- etc.
Q: Do I need to use Makefile?
A: No, you can still use bash install.sh directly. Makefile is just a convenience wrapper.
Q: Can I add my own commands? A: Yes, edit the Makefile and add your custom targets.
Q: Why do some commands need sudo? A: Commands that modify system files or services need root privileges. Makefile handles this automatically.
Q: Can I use this in scripts? A: Yes, you can use make commands in your automation scripts.
Q: What if I don't have make installed? A: Install it with your package manager or use the direct script commands.
The Makefile provides:
- 🚀 Quick shortcuts for all commands
- 📝 Easy to remember command names
- ✅ Built-in help and documentation
- 🔧 Utility functions for testing and maintenance
- 💡 Short aliases for frequent tasks
Instead of:
sudo bash install.sh add_dev_user johnJust type:
make au USER=johnEnjoy the simplified workflow! 🎉