An opinionated view on installing software.
A collection of stand-alone bash scripts for provisioning a bare metal server.
To install from scratch, run
bash <(curl -s https://raw.githubusercontent.com/capbash/bits/master/bits-installer)
This will install capbash into /usr/local/bin/bits. To install it somewhere else, for example:
bash <(curl -s https://raw.githubusercontent.com/capbash/bits/master/bits-installer) --path /tmp
If you don't trust this project, please don't pipe into bash, and instead download the file, inspect it and run it directly.
If you already have bits and want to upgrade to the altest, please run
bits update-self
Once your bits installed (from above), you can install other bits by running
bits install <BIT_NAME>
For example,
bits install elixir
All available configurations are managed through environment variables. If you wanted a different version of elixir, then you would run
ELIXIR_VERSION=1.11.4 bits install elixir
If you don't like the idea of installing the "bits" command line tool, then you can install the bits directly using bash and curl.
For example
bash <(curl -s https://raw.githubusercontent.com/capbash/bits/master/elixir.bits)
To override defaults, set it as an environment variable
ELIXIR_VERSION=1.11.4 bash <(curl -s https://raw.githubusercontent.com/capbash/bits/master/elixir.bits)
If you don't trust this project, please don't pipe into bash, and instead download the file, inspect it and run it directly.
Install Apache 2. Available configurations with defaults include
APACHE_VERSION=2.4.25
APACHE_UPDATERC=true
To install, run
bits install apache
If APACHE_UPDATERC is set to true, it will register itself with update-rc to automatically start when booting up the system.
Once installed, you can see the availbale options by running
sudo service apache
Brew is the Missing Package Manager for macOS (or Linux).
To install, run
bits install brew
Certbox is a replacement to Let's Encyrpt script.
To install, run
bits install certbot
Installs Chrome Driver on your system. Available configurations with defaults include
CHROMEDRIVER_VERSION=2.21
To install, run
bits install chromedriver
Composer is a dependency manager for PHP.
To install, run
bits install composer
Creates a Digital Ocean droplet that is ready for development. It will create the specified IMAGE of a specific SIZE.
This bit requires Dio installed locally, with a valid TOKEN to access the Digital Ocean API.
PREFIX=devbox
NAME=${PREFIX}${TS}
IMAGE=ubuntu-14-04-x64
SIZE=512mb
SLEEP=60
LOGFILE=/tmp/devbox_$NAME.log
To install, run
bits install devboxdio
Installs Doctl is a command line interface to Digital Ocean API
DOCTL_VERSION=1.6.1
PLATFORM=linux
DOCTL_BIN=/opt/doctl/1.6.1/bin
To install, run
bits install doctl
Installs Elixir, which also needs Erlang, on your system.
These scripts are definitely biased towards Ubuntu, so you will probably want to stay within this family of distibutions:
- Ubuntu 14.04
trusty
- Ubuntu 16.04
xenial
- Ubuntu 18.04
bionic
Available configurations with defaults include
# From erlang.bits
ERLANG_VERSION=23.2-1
ELIXIR_VERSION=1.11.4
To install, run
bits install elixir
Installs Erlang on your system. Available configurations with defaults include
ERLANG_VERSION=23.2-1
To install, run
bits install erlang
Install git.
GIT_VERSION=latest
To install, run
bits install git
Clone a git project. Available configurations with defaults include
NAME=samplephp
URL=https://github.com/capbash/samplephp
INSTALL_DIR=/var/local/apps
USER_EMAIL=server@localhost
USER_NAME=server
GIT_REMOTE=origin
BRANCH=master
TAG=master
To install, run
NAME=samplephp \
URL=https://github.com/capbash/samplephp \
TAG=v0.2 \
bits install gitclone
Configure a remote git to the desired settings. Available configurations with defaults include
EMAIL=you@example.com
USERNAME="Ben Dover"
EDITOR=vi
PUSH=simple
To install, run
EMAIL=yourname@example.com \
USERNAME=yourname \
bits install gitconfig
Configure your bash prompt to show important git branch information. Once configured your prompt will look similar to:
11:35 /src/bits (master)$
To install, run
bits install gitprompt
Configure a inotify-tools on your server.
To install, run
bits install inotify
Configure a ION Cube on your server.
Available configurations with defaults include
PHP_LIB_DATE=20131226
PHP_LIB_DIR=/usr/lib/php/${PHP_LIB_DATE}
PHP_VERSION=5.6
CONFD_DIR=/etc/php/${PHP_VERSION}/apache2/conf.d
To install, run
bits install ioncube
Configure a JumpCloud daemon on your server.
To install, run
JUMPCLOUD_TOKEN=fill_me_in \
bits install jumpcloud
Configure your server to trust all hosts so that you can, for example, access services like GitHub and Bitbucket to download code.
To install, run
bits install knownhosts
This is obsolete, use certbox instead.
Installs Let's Encyrpt. To install, run
bits install letsencrypt
Installs libsass and sassc (needed by node-sass and useful with Phoenix). A thank you to edouard-lopez for the fix.
To install, run
bits install libsass
Based on Digital Oceans Marketplace Docs, this will install two helper scripts.
To install, run
bits install marketplace-partners
After being installed, two helper scripts are available
First, the clean-up your image
/usr/local/bin/marketplace-cleanup
Second, to verify your image
/usr/local/bin/marketplace-validation
Install Nginx.
To install, run
bits install nginx
Once installed, you can see the availbale options by running
systemctl status nginx
A huge thank you to Digital Ocean for the instalation documentation.
Install NodeJS. Available configurations with defaults include
NODE_VERSION=11.9.0
bits install nodejs
Install OpenSSH server.
bits install openssh-server
Installs MySQL. Available configurations with defaults include
MYSQL_VERSION=5.7.24
MYSQL_USER=mysql
MYSQL_DATADIR=/usr/local/mysql/data
MYSQL_ROOT_PASSWORD=nicetry
Available MYSQL versions include (and will change frequently)
- 5.5.62
- 5.6.42
- 5.7.24
To install, run
bits install mysql
Installs Ncurses required for Erlang. To install, run
bits install ncurses
Installs PHP. Available configurations with defaults include
PHP_VERSION=5.6
Available PHP versions include
- 5.6
To install, run
bits install php
Installs Pip. Available configurations with defaults include
# From python.bits
PYTHON_VERSION=2.7.11
To install, run
bits install pip
Installs Python. Available configurations with defaults include
PYTHON_VERSION=2.7.11
To install, run
bits install python
Installs Erlang (using erlang.bits) and Elixir (using elixir.bits), Sass (using sass.bits), Libsass (through sass.bits), Ruby (through sass.bits), Postgres (using postgres.bits), Node JS (using nodejs.bits) and then installs Phoenix. Available configurations with defaults include
# From erlang.bits
ERLANG_VERSION=23.2-1
# From elixir.bits
ELIXIR_VERSION=1.11.4
# From gitconfig.bits
EMAIL=you@example.com
USERNAME="Ben Dover"
EDITOR=vi
PUSH=simple
# From postgres.bits
POSTGRES_VERSION=11
PGADMIN_VERSION=3
# From ruby.bits (through sass.bits)
RUBY_VERSION=2.2.3
PHOENIX_VERSION=1.5.8
NODE_VERSION=11.9.0
To install, run
bits install phoenix
You must ensure that your remote machine has the proper access to the git server. This could be done, by scp'ing a trusted public/private key that is authorized by your git server.
For example,
scp $HOME/.ssh/id_rsa.pub <remote_server>:/root/.ssh/
scp $HOME/.ssh/id_rsa <remote_server>:/root/.ssh/
Installs Erlang (using erlang.bits) and Elixir (using elixir.bits), and then Postgres (using postgres.bits), and Node JS (using nodejs.bits) and Phoenix (using phoenix.bits). Then it will download a phoenix umbrella app where the phoenix web app should be located at ./apps/webapp. If you want to configure your app differently, then just spin up a phoenix.bit and configure as you wish.
Available configurations with defaults include
# From erlang.bits
ERLANG_VERSION=23.2-1
# From elixir.bits
ELIXIR_VERSION=1.11.4
# From gitconfig.bits
EMAIL=you@example.com
USERNAME="Ben Dover"
EDITOR=vi
PUSH=simple
# From postgres.bits
POSTGRES_VERSION=11
PGADMIN_VERSION=3
# From phoenix.bits
PHOENIX_VERSION=1.5.8
NODE_VERSION=11.9.0
SRC_DIR=/src
GIT_URL="git@bitbucket.org:capbash/samplephoenix.git"
GIT_BRANCH="master"
PROJECT_NAME="samplephoenix"
To install, run
GIT_URL=git@github.com:capbash/samplephoenix.git \
PROJECT_NAME=samplephoenix \
bits install phoenixapp
Creates a Digital Ocean private image with everything to quickly spin up a phoenix ready development environment. It does not expose all available configurations (e.g. which version of ERLANG, or NODE_JS), so if you need something more customizable, then please consider wrapping this functionality directly.
This bit requires Dio installed locally, with a valid TOKEN to access the Digital Ocean API.
ERLANG_VERSION=23.2-1
ELIXIR_VERSION=1.11.4
PHOENIX_VERSION=1.5.8
POSTGRES_VERSION=11
NAME=elixir${ELIXIR_VERSION//[.|-]/}phoenix${PHOENIX_VERSION//[.|-]/}postgres${POSTGRES_VERSION//[.|-]/}
LOGFILE=/tmp/$NAME.log
SIZE=512mb
SLEEP=60
To install, run
bits install phoenixdio
Installs Postgres.
The distributions and versions are available at:
These scripts are definitely biased towards Ubuntu, so you will probably want to stay within this family of distibutions:
- Ubuntu 14.04
trusty
- Ubuntu 16.04
xenial
- Ubuntu 18.04
bionic
Available configurations with defaults include
POSTGRES_VERSION=11
PGADMIN_VERSION=3
To install, run
bits install postgres
Installs Redis. Available configurations with defaults include
REDIS_VERSION=stable
To install, run
bits install redis
Installs Ruby.
These scripts are definitely biased towards Ubuntu, so you will probably want to stay within this family of distibutions:
- Ubuntu 14.04
trusty
- Ubuntu 16.04
xenial
- Ubuntu 18.04
bionic
# (not supported yet)
Available configurations with defaults include
RUBY_VERSION=2.5.3
RUBY_MODE=bin # or source
To install, run
bits install ruby
Installs SASS. Available configurations with defaults include
RUBY_VERSION=2.2.3
To install, run
bits install sass
Creates a Digital Ocean snapshot for re-use.
This bit requires Dio installed locally, with a valid TOKEN to access the Digital Ocean API.
ID=${ID}
NAME=${NAME}
DELETE=false
To create an image called myapp
against a droplet 1234 (could also be it's name, if it is
unique, then run
ID=1234 NAME=myapp bits install sass
If you have DELETE=true
, then it will delete the snapshot when it's done.
Install swap space on you server Available configurations with defaults include
SWAP_SIZE=4G
To install, run
bits install swap
The uncomplicated firewall should be installed, but if it's not you can install it using
bits install ufw