{"id":20208150,"url":"https://github.com/cubiclesoft/server-instant-start","last_synced_at":"2026-03-05T09:01:52.064Z","repository":{"id":45822570,"uuid":"324577863","full_name":"cubiclesoft/server-instant-start","owner":"cubiclesoft","description":"Spin up a fully configured Ubuntu/Debian-based web server in under 10 minutes with Nginx (w/ HTTPS), PHP FPM, Postfix, OpenDKIM, MySQL/MariaDB, PostgreSQL, and more.  Deploy your web application too.","archived":false,"fork":false,"pushed_at":"2022-02-26T15:07:42.000Z","size":110,"stargazers_count":21,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-10T13:10:04.622Z","etag":null,"topics":["automation","cfgmgt","deployment","devops","infrastructure"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cubiclesoft.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-12-26T15:02:23.000Z","updated_at":"2024-11-26T17:34:43.000Z","dependencies_parsed_at":"2022-08-05T19:16:00.784Z","dependency_job_id":null,"html_url":"https://github.com/cubiclesoft/server-instant-start","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cubiclesoft/server-instant-start","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cubiclesoft%2Fserver-instant-start","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cubiclesoft%2Fserver-instant-start/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cubiclesoft%2Fserver-instant-start/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cubiclesoft%2Fserver-instant-start/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cubiclesoft","download_url":"https://codeload.github.com/cubiclesoft/server-instant-start/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cubiclesoft%2Fserver-instant-start/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30117479,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T08:19:04.902Z","status":"ssl_error","status_checked_at":"2026-03-05T08:17:37.148Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","cfgmgt","deployment","devops","infrastructure"],"created_at":"2024-11-14T05:34:20.820Z","updated_at":"2026-03-05T09:01:52.032Z","avatar_url":"https://github.com/cubiclesoft.png","language":"PHP","readme":"Server Instant Start\n====================\n\nSpin up a fully configured Ubuntu/Debian-based web server in under 10 minutes with Nginx (w/ HTTPS), PHP FPM, Postfix, OpenDKIM, MySQL/MariaDB, PostgreSQL, and more.  Deploy your web application too.\n\nInstant Start is useful for setting up an entire server with minimal effort.  Quickly install all components of a server in just a couple of minutes:  A well-rounded OS configuration plus optional configuration of web server, email sending capabilities, a scripting language, and database(s).  The contents of and knowledge contained in this repository come from responsibly managing many Linux-based web servers for over a decade.\n\n[![Server Instant Start Overview and Demo video](https://user-images.githubusercontent.com/1432111/104147985-ae9dbf80-538d-11eb-863b-9a0a0cd593ac.png)](https://www.youtube.com/watch?v=l3yimAjmo9c \"Server Instant Start Overview and Demo\")\n\nOnly using Instant Start on a brand new server is highly recommended.  Any Debian-based Linux distribution will probably work fine.  Failure to use Instant Start on a newly created system may result in damage to existing configuration files and/or data loss.\n\n[![Donate](https://cubiclesoft.com/res/donate-shield.png)](https://cubiclesoft.com/donate/) [![Discord](https://img.shields.io/discord/777282089980526602?label=chat\u0026logo=discord)](https://cubiclesoft.com/product-support/github/)\n\nFeatures\n--------\n\n* A simple set of scripts that automatically install and configure several software products.\n* Your new server is ready to use in just a couple of minutes.\n* Nearly zero configuration required (see below).\n* Has a liberal open source license.  MIT or LGPL, your choice.\n* Designed for rapid deployment.\n* Sits on GitHub for all of that pull request and issue tracker goodness to easily submit changes and ideas respectively.\n\nGetting Started\n---------------\n\nOpen the following in a new tab to start creating a Droplet on DigitalOcean:\n\n[![Deploy to DO](https://mp-assets1.sfo2.digitaloceanspaces.com/deploy-to-do/do-btn-blue.svg)](https://cloud.digitalocean.com/droplets/new?size=s-1vcpu-1gb\u0026distro=ubuntu\u0026options=ipv6)\n\n(Read the Alternate VPS Setup section below for using Instant Start with other VPS providers.)\n\nUsing the latest Ubuntu x64 Long-Term Support (LTS) release is recommended.\n\nUnder \"Select additional options\" check the checkbox that says \"User data\".  Copy and paste the following script into the box that appears and modify it as you see fit:\n\n```sh\n#!/bin/sh\n\nexport DEBIAN_FRONTEND=noninteractive;\n\napt-get update;\napt-get -y dist-upgrade;\napt-get -y install openssl git wget curl php-cli;\n\nexport PUBLIC_IPV4=$(curl -s http://169.254.169.254/metadata/v1/interfaces/public/0/ipv4/address);\nexport PUBLIC_IPV6=$(curl -s http://169.254.169.254/metadata/v1/interfaces/public/0/ipv6/address);\n\n# A list of timezones can be found here:  https://en.wikipedia.org/wiki/List_of_tz_database_time_zones\n# Or automatic:  https://geoip.ubuntu.com/lookup\nexport TZ=\"\";\n\n# Set the hostname.  What to name this server?\nexport INSTANT_HOSTNAME=\"\";\n\n# Set the configured domain(s) to use (e.g. yourdomain.com, anotherdomain.com).\nexport INSTANT_EMAIL_DOMAIN=\"\";\nexport INSTANT_WWW_DOMAINS=\"\";\n\n# Select servers to install (if any).\n# Options:  nginx, php-fpm, email-sendonly, mariadb, mysql, postgresql, php-drc\nexport INSTANT_SERVERS=\"\";\n\ncd /root;\n\n# Optionally clone useful but unrelated CubicleSoft network and server management software.\n# NOTE:  Some software products require separate installation/configuration (e.g. Cloud Backup is not magical).\n#git clone https://github.com/cubiclesoft/net-test.git;\n#git clone https://github.com/cubiclesoft/network-speedtest-cli.git;\n#git clone https://github.com/cubiclesoft/php-ssh.git;\n#git clone https://github.com/cubiclesoft/php-ssl-certs.git;\n#git clone https://github.com/cubiclesoft/cloud-backup.git;\n\n# Clone and run Server Instant Start.\ngit clone https://github.com/cubiclesoft/server-instant-start.git;\n\ncd /root/server-instant-start;\nphp install.php init-system php-cli;\n\n# Put additional installation stuff here (e.g. your application installer).\n\n# Comment this out if you want to reboot manually later.\ncd /root/server-instant-start;\nphp install.php reboot-if-required;\n```\n\nUpdate the `export TZ=` line with your current timezone.  This will be used to set the timezone of the Droplet and associated software (e.g. PHP) so that dates and times are stored and displayed as expected.  The timezone also affects any cron jobs that are set up.  Leave it blank for `UTC +0000`.\n\nThe other `export` options are optional.  Fill out the desired configuration and uncomment/include any additional software you want to install/configure later.\n\nEven after the Droplet becomes available, it can be a few minutes before the server is fully configured.  To watch the installation/configuration progress, run the following command from a SSH terminal:\n\n```\ntail -f /var/log/cloud-init-output.log\n```\n\nWhen the server installation is finished, a file called `/root/README-ServerInstantStart` will be created which contains credentials for various server resources (e.g. MariaDB root password).  SSH or SFTP is required to read the file.\n\n```\ncat /root/README-ServerInstantStart\n```\n\nAfter installation, configure DNS to point at the IP address(es) of the new system.  Then run the post-install script to set up HTTPS and/or DKIM:\n\n```\ncd /root/server-instant-start\nphp post-install.php https nginx yourdomain.com www.yourdomain.com\nphp post-install.php dkim create default yourdomain.com\nphp post-install.php dkim verify default yourdomain.com\n```\n\nKey Locations\n-------------\n\n* `/var/www/yourdomain.com/public_html` - The public web root for a domain.\n* `/var/www/yourdomain.com/protected_html` - A private directory for a domain.\n* `/var/scripts` - Various automation scripts (e.g. cron jobs).\n* `/etc/iptables/rules.v4` and `/etc/iptables/rules.v6` - Firewall rules (iptables).\n* `/opt/php-drc` - Data Relay Center configuration.\n\nAlternate VPS Setup\n-------------------\n\nTo run this software, you need an Ubuntu/Debian OS distribution on a Virual Private Server (VPS) or dedicated host.  Providers like DigitalOcean, OVH, AWS, Azure, etc. make it easy to spin up a VPS.\n\nThe shell script under the Getting Started section is also in `example_install.sh`.  For non-DigitalOcean hosts, just upload files, manually modify `PUBLIC_IPV4` and `PUBLIC_IPV6` in `example_install.sh` with correct IP address(es), perform a `chmod 755 example_install.sh`, and then execute the script as the `root` user `./example_install.sh`.\n\nDigitalOcean is primarily for quickly setting up a temporary Internet-facing server, which is good for trying out new things like Server Instant Start, testing some software in isolation, or for short-lived projects.  Web hosting service providers abound but most of those are shared hosts with little control.  A Virtual Private Server (VPS), which is what DigitalOcean mostly offers/provides, is something between shared hosting and cloud/dedicated hosting.  Droplets are intended to be cheap, short-lived VPS instances that are created and destroyed as needed.  Even though Droplets weren't really ever intended for normal web hosting, quite a few people use them that way.\n\nRunning a VPS (or similar) comes with responsbilities.  The biggest one is making sure that the system is secure, which means that the system remains fully patched because it won't automatically be done for you.  Server Instant Start solves a number of configuration management problems by performing an opinionated installation that attempts to create a generally self-securing setup.  For example, it installs a PHP script that runs `apt-get dist-upgrade` with automatic rebooting as needed (e.g. kernel updates) and configures cron to automatically run that script every single day.\n\nIf the intent is to run a server long-term, I highly recommend using an [OVH VPS](https://www.ovhcloud.com/en/vps/cheap-vps/) instead of DigitalOcean since OVH offers a lot more hardware and network transfer for less cost but slightly less comprehensive technical support.\n\nInstalled Software\n------------------\n\nAlways installed and configured:\n\n* PHP CLI.\n* fail2ban.  Slows down attackers.\n* iptables-persistent.  Sane default firewall rules.\n* net-tools.  netstat, etc.\n* vnstat.  Tracks monthly network transfer.\n* htop.  A much better top.\n* Fully automated system update script (except major OS upgrades).\n* PHP extensions (cURL, JSON, PDO sqlite, GD).\n\nOptionally installed and configured:\n\n* Postfix.\n* OpenDKIM.  Post-install only.\n* Nginx.\n* Let's Encrypt.  Post-install only.\n* PHP FPM.\n* PHP extensions (PDO mysql, PDO postgres, PECL ev).\n* MariaDB/MySQL.\n* PostgreSQL.\n* [Data Relay Center](https://github.com/cubiclesoft/php-drc).\n\nModified Files\n--------------\n\nThe following changes are made to the system by Instant Start that some distro purists may disagree with.  These are documented so that you can decide if you want to adjust specific changes later or install and configure specific packages yourself.\n\nAlways modified:\n\n* `/etc/sysctl.conf` - Changes a few various kernel options for improved uptime and security.  See [this post](http://cubicspot.blogspot.com/2016/06/elegant-iptables-rules-for-your-linux.html) for details.\n* `/etc/security/limits.conf`, `/etc/systemd/system.conf`, `/etc/systemd/user.conf`, `/etc/pam.d/common-session`, and `/etc/pam.d/common-session-noninteractive` - Set OS file handle limits.  See [this post](https://superuser.com/questions/1200539/cannot-increase-open-file-limit-past-4096-ubuntu) for details.\n\nWhen `INSTANT_HOSTNAME` is set (i.e. not an empty string):\n\n* `/etc/hostname`, `/etc/hosts` - Sets the hostname to the value in `INSTANT_HOSTNAME`.\n* `/etc/cloud/cloud.cfg` - Disables setting the hostname during boot.\n\nWhen `INSTANT_SERVERS` contains 'nginx':\n\n* `/etc/apt/sources.list` - Adds the official Nginx packages from nginx.org to the apt sources list since Debian lags behind several releases.\n* `/etc/nginx/nginx.conf` - Created using the template from [scripts/files/nginx_core.txt](scripts/files/nginx_core.txt).\n* `/etc/nginx/sites-available/default.conf` - Created using the template from [scripts/files/nginx_site_default.txt](scripts/files/nginx_site_default.txt).\n\nWhen `INSTANT_SERVERS` contains 'php-fpm':\n\n* `/etc/php/.../fpm/php.ini` - Increases various limits, enables the Zend opcache, and sets the timezone.\n* `/etc/php/.../fpm/pool.d/www.conf` - Switches from Unix sockets to TCP and switches to on-demand mode to better optimize system resources.\n\nWhen `INSTANT_SERVERS` contains 'email-sendonly':\n\n* `/etc/postfix/main.cf` - Sets the mail hostname via `INSTANT_EMAIL_DOMAIN` and applies a couple of sensible changes to prevent an open mail relay.\n\nWhen `INSTANT_SERVERS` contains 'mariadb':\n\n* `/etc/apt/sources.list` - Adds the official MariaDB packages from a DigitalOcean mirror to the apt sources list since Debian lags behind several releases.\n\nMore Information\n----------------\n\nThe PHP installation script `install.php` aims to be idempotent.  That is, if it is run again intentionally or by accident, it will result in the same output.\n\nA system group called `sftp-users` is created during the installation process.  The `setgid` attribute is set on various key locations so that any user assigned to the group can easily create new files in a team setting.  Just assign the `sftp-users` group to members of your team.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcubiclesoft%2Fserver-instant-start","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcubiclesoft%2Fserver-instant-start","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcubiclesoft%2Fserver-instant-start/lists"}