Quick and easy (if you are using HomeBrew): copy and paste the line below into a terminal:
If you are not using HomeBrew, try the method below. The information below was taken from Tiago's github page, where a possibly more recent version is available.
A system-wide installation is preferred though to ensure the layout is available to all applications. (See also this Superuser answer.)
Open your keyboard preferences in
System Preferences > Keyboard > Input Sources and click
+ button on the bottom left side and select AltGr WEur under Others:
The macOS version of AltGr-WEur is kindly provided by Tiago Sousa.