diff --git a/documents/guides/local_setup_ubunutu_wsl_from_scratch.md b/documents/guides/local_setup_ubunutu_wsl_from_scratch.md new file mode 100644 index 000000000..6564aea27 --- /dev/null +++ b/documents/guides/local_setup_ubunutu_wsl_from_scratch.md @@ -0,0 +1,122 @@ +# Local Teiserver setup + +Using WSL with Ubuntu 22.0.4 downloaded from the windows store + +Installed git, curl, and unzip +```bash +sudo apt install git curl unzip +``` +git and curl were already pre-installed with their latest available versions. + +Installed [asdf](https://github.com/asdf-vm/asdf) for managing versinos of elixir and erlang: +```bash +git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.14.0 +``` + +Set up asdf in bashrc: +```bash +echo ' +. "$HOME/.asdf/asdf.sh" +. "$HOME/.asdf/completions/asdf.bash"' >> ~/.bashrc +``` + +Add asdf plugins for elixir and erlang: +```bash +asdf plugin-add elixir https://github.com/asdf-vm/asdf-elixir.git +asdf plugin add erlang https://github.com/asdf-vm/asdf-erlang.git +``` + +Install dependencies for erlang install: +```bash +sudo apt-get -y install build-essential autoconf m4 libncurses5-dev libwxgtk3.0-gtk3-dev libwxgtk-webview3.0-gtk3-dev libgl1-mesa-dev libglu1-mesa-dev libpng-dev libssh-dev unixodbc-dev xsltproc fop libxml2-utils libncurses-dev openjdk-11-jdk +``` + +Install elixir and erlang versions tracked in project (must be done from root of project) +```bash +asdf install +``` + +Get and compile local elixir dependencies (say yes to prompts for additional installs): +```bash +mix deps.get +mix deps.compile +``` + +Install postgres: +```bash +sudo apt install postgresql +``` + +Set password for postgres user (account should have been created automatically by the apt install) +```bash +sudo passwd postgres +``` + +Start postgres service: +```bash +sudo service postgresql start +``` + +Set up `teiserver_dev` and `teiserver_test` accounts: +```bash +sudo su postgres +psql postgres postgres <