Linux Web Development Setup for 2023

Linux Web Development Setup for 2023

And the magic it will bring with ASDF, Elixir, Phoenix, PostgreSQL, Git and Neovim

Setup your Development Machine

> sudo apt-get update

> sudo apt-get install terminator

> sudo apt-get install neovim

> sudo apt-get update

Setup File Searching

> sudo apt-get install rg

Git Setup

> sudo apt install git

> git config --global push.default simple

> git config --global user.email "<your-email>"

> git config --global user.name "<your-name>"

> git config --global alias.lg "log --color --graph --
pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"

Oh-my-ZSH Setup

> sudo apt install zsh curl

> zsh --version

> chsh -s $(which zsh)

> sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Neovim Development Setup

> mkdir ~/.config

> git clone https://gitlab.com/jethro.riosa/neovim-setup.git ~/.config/nvim

> ~/.config/nvim/zsh_script.sh

> source ~/.zshrc

> git clone https://github.com/k-takata/minpac.git ~/.config/nvim/pack/minpac/opt/minpac
  • Open terminator.

  • In your terminator, type vim, this will show your vim editor.

  • Press Shift + Colon and type PackUpdate to install packages.

> vim ~/.zshrc
  • Change the value of ZSH value.
export ZSH="PATH/.oh-my-zsh"
  • save your ~/.zshrc file and the type source ~/.zshrc in your terminator.

ASDF troubleshooting

> git clone https://github.com/asdf-vm/asdf.git ~/.asdf

> git clone https://github.com/olivierverdier/zsh-git-prompt.git

> source ~/.zshrc

Install Elixir

> asdf plugin-add elixir https://github.com/asdf-vm/asdf-elixir.git

> asdf install elixir latest

> asdf global elixir latest

Install Erlang

> asdf plugin add erlang https://github.com/asdf-vm/asdf-erlang.git

> asdf install erlang latest

> asdf global erlang latest

Install Node

> asdf plugin add nodejs https://github.com/asdf-vm/asdf-nodejs.git

> asdf install nodejs latest

> asdf global nodejs latest

Install Phoenix

> mix local.hex

> elixir -v

> mix archive.install hex phx_new

Install PostgreSQL

> psql -v

> sudo apt-get install postgresql

> sudo apt-get update

> psql --version
  • psql -v will help to check if there is an already installed version on your system. If it doesn't show anything or an error, we can proceed to the next step.
> sudo -u postgres psql postgres

> \password postgres

> sudo -u postgres createuser --superuser $USER
  • The first command creates a new Postgres account.

  • The second command opens up the psql console and asks for you to enter a password for the account created ( which is Postgres). From there you can just enter postgres

  • The third command makes your newly created account to be a superuser and add specific privileges.

Install Inotify for File Watching

sudo apt-get install inotify-tools

Create a new Phoenix Project

> mix phx.new hello_world

> cd hello_world

> mix ecto.create

> mix phx.server
ย