Skip to content

Installation (WSL)

Jesper Bertijn edited this page Jun 6, 2023 · 5 revisions

For clarity's sake, these instructions will be based on Ubuntu/Debian type distributions. Not every distribution is the same, and therefore not everything may apply to you if you choose to try a different distribution. If you prefer a different distribution, some steps may not be relevant to you.

Installing Ubuntu.

  1. Install Ubuntu from the MS Store. Both base versions and specific LTS versions may be used. Follow the installer and create a user.
  2. Go to Docker Desktop > Settings > Resources > Check Enable integration with my default WSL distro and check Ubuntu.
  3. Run sudo apt update && sudo apt upgrade to get your kernel and packages up to the latest version.
  4. Run sudo apt install nodejs npm 7zip php composer php-xml php-mbstring php-curl; this installs all the dependencies that you need for the project.

Adjusting Node version.

Some distributions come with a preinstalled version of Node, and they are likely not the latest version even if you've installed the packages freshly. To fix this, we will use the NodeJS n module:

  1. Run sudo npm cache clean -f.
  2. Run sudo npm install -g n.
  3. Run sudo n stable.

This will update your Node version to the most recent stable version. Alternatively, you can replace stable with latest if you like to live dangerously.

Installing the project locally.

  1. Clone the project within the /home/<user>/ directory. This is typically the default starting point for your terminal.
  2. cd into the project.
  3. Refer to the readme.

Filesystem navigation.

Entering the folders.

⚠️ The WSL filesystem and subfolders are inaccessible when WSL is not running.

In the Windows file explorer, in the address bar, you can type \\wsl$ to enter the filesystem. You will see docker-desktop and docker-desktop-data, along with your other WSL distributions. Ignoring the Docker folders, you can freely mess around with any files in here.

Deleting an installed distribution.

Open a Windows terminal and type wsl --unregister <distribution>. These names are identical to the ones found in \\wsl$.

Adding a bash alias.

In the home/user directory, there is a .bashrc file. You can add an alias here to avoid having to retype ./vendor/bin/sail each time, and shorten it to sail instead.

⚠️ The nano text editor is difficult to use. If you get stuck, ask a teacher or a fellow teammate.

  1. Navigate to your /home/user directory.
  2. Run nano .bashrc.
  3. Copy alias sail='[ -f sail ] && sh sail || sh vendor/bin/sail' and paste it in the file.
  4. Save the file.
  5. Restart all active shells.