What is n8n?
n8n is an extendable workflow automation tool. With a fair-code distribution model, n8n will always have visible source code, be available to self-host, and allow you to add your own custom functions, logic and apps. n8n's node-based approach makes it highly versatile, enabling you to connect anything to everything. -https://github.com/n8n-io/n8n
Installing Homebrew Package Manager
	- Start LaunchPad from the dock
 
	- Search terminal > Click Terminal to launch it
 
	- Run the following commands in the terminal window
	
# if prompted, click install and agree to install command line tools
	# install homebrew
	/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
	# enter your password
	# press Enter to continue
	 
Installing n8n
	- Run the following commands in a terminal window
	
# install nodejs
	brew install node@16
	# correct brew link to nodejs v16
	brew unlink node
	brew link --overwrite node@16
	# install mariadb
	brew install mariadb
	# start the mariadb service
	mysql.server start
	# set mariadb service to autostart
	brew services start mariadb
	# connect to the database
	sudo mysql -uroot
	 
	- Run the following commands to create the n8n database and database user
	
CREATE DATABASE n8n;
	GRANT ALL ON n8n.* to 'n8n_rw'@'localhost' IDENTIFIED BY 'n8n_N8N!';
	FLUSH PRIVILEGES;
	EXIT;
	 
	- Continue with the following commands:
	
# set environmental variables
	export DB_TYPE="mysqldb"
	export DB_MYSQLDB_DATABASE="n8n"
	export DB_MYSQLDB_HOST="localhost"
	export DB_MYSQLDB_USER="n8n_rw"
	export DB_MYSQLDB_PASSWORD='n8n_N8N!'
	export GENERIC_TIMEZONE="America/New_York"
	# install n8n
	sudo npm install n8n --location=global
	# run n8n
	sudo n8n start
	 
	- Open a web browser and navigate to http://DNSorIP:5678
 
	- Complete the form with an email, first name, last name and password > Click next
 
	- Complete the questionnaire > Click continue
 
	- Click Get started
 
	- Welcome to n8n
 
Source: https://docs.n8n.io/hosting/installation/npm/