Shortest possible shell script to install WordPress on Nginx server?

Having the “shortest” script is a fairly pointless goal here I think, besides for entertainment purposes. But if you are looking for something that is very minimal and easy to understand, you can check out Bash scripts like my own free SlickStack project on GitHub, which is geared toward LEMP stack newbies.

Keep mind that if you integrate something like WP-CLI, it might appear to be “shorter” commands, but the backend is a rather complicated system of scripts and aliases. And by the time you’ve installed WP-CLI and ran through all the necessary commands, it might not save much time…

You also seem to skip over PHP-FPM and MySQL installation which WordPress requires, not to mention other common things like MU (Must-Use) plugins and drop-in plugins e.g. object-cache.php which is pretty mainstream these days, also wp-config.php configuration, and so forth.

I spent years putting SlickStack together, employing an extremely user-friendly and minimal approach, and yet it still ended up containing several different Bash scripts… ultimately, anytime you are getting into server management and DevOps tools, it is probably going to require more than 30 lines of code! In the case of SlickStack, the ss-config file is where you can modify all your stack variables and options, before installation, meaning that you don’t have to edit any of the actual Bash scripts.

You can also search public Gists on GitHub, which tend to be smaller in size than repos.

Leave a Comment