# Developing a Litium 8 site on macOS

**URL:** <https://forum.litium.com/t/developing-a-litium-8-site-on-macos/2361>\
**Category:** Questions\
**Created:** [December 17, 2021, 2:45pm UTC](https://forum.litium.com/t/developing-a-litium-8-site-on-macos/2361 "2021-12-17T14:45:20Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Christian.Engvall](https://avatars.discourse-cdn.com/v4/letter/c/919ad9/32.png) [@Christian.Engvall](https://forum.litium.com/u/Christian.Engvall)\
**Post date:** [December 17, 2021, 2:45pm UTC](https://forum.litium.com/t/developing-a-litium-8-site-on-macos/2361/1 "2021-12-17T14:45:20Z")

</div>

Hi there!  
I’m trying to set up a developer environment for Litium 8 on macOS.

I’ve gotten so far so far so that .NET complains about that it can’t connect to the SQL-server running in docker.  
I’ve also got some problems generating a certificate as explained in the github-repo, which is probably why the apps(payment and delivery) isn’t starting.

Maybe someone else is trying to accomplish the same or you guys at Litium knows how to set it up correctly?

I thought I’d share the steps I’ve figured out so far, if someone else want to give it a go.  
That will probably save you some time.

1. System requirements:  
**Install .NET 5 sdk:**  
[Download .NET 5.0 (Linux, macOS, and Windows)](https://dotnet.microsoft.com/en-us/download/dotnet/5.0)

Then install the rest of the requirements as stated here: [System requirements](https://docs.litium.com/documentation/get-started/system-requirements)

**2. Configure nuget**  
As explained here: [Litium packages](https://docs.litium.com/documentation/get-started/litium-packages)

You might get this error:  
_error: Password encryption is not supported on .NET Core for this platform. The following feed try to use an encrypted password: ‘Litium’. You can use a clear text password as a workaround._  
_error: Encryption is not supported on non-Windows platforms._

Solved by storing passwords in clear text. (?! What could go wrong?) Like this:  
dotnet nuget add source [https://nuget.litium.com/nuget/](https://nuget.litium.com/nuget/) -n Litium -u -p --store-password-in-clear-text

**3 Installing docker:**

> **[Install Docker Desktop on Mac](https://docs.docker.com/desktop/mac/install/)**
>
> How to install Docker Desktop on Mac

and do this:  
docker login registry.litium.cloud -u username

**4. The dev cert**  
Install powershell as a global tool, that way we can use the same syntax as here: [Education/Developer Education/Tasks/Developer certificate at main · LitiumAB/Education · GitHub](https://github.com/LitiumAB/Education/tree/main/Developer%20Education/Tasks/Developer%20certificate)

> **[Installing PowerShell on macOS - PowerShell](https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-macos?view=powershell-7.2#install-as-a-net-global-tool)**
>
> Information about installing PowerShell on macOS

However on number 5. i get an error telling me that i havent got a valid .pfx-file. (Now what? i have no idea yet. maybe someone knows what to do?)

To temporarily get passed this step, and being able to continue i just generated a dev cert and went along with it like this:

dotnet dev-certs https -ep ${HOME}/.aspnet/https/aspnetapp.pfx -p “123456”  
dotnet dev-certs https --trust

**5. The docker task**  
Do this task:

> **[Education/Developer Education/Tasks/Docker at main · LitiumAB/Education](https://github.com/LitiumAB/Education/tree/main/Developer%20Education/Tasks/Docker)**
>
> main/Developer%20Education/Tasks/Docker

**6. The installation task**  
start here [Education/Developer Education/Tasks/Installation at main · LitiumAB/Education · GitHub](https://github.com/LitiumAB/Education/tree/main/Developer%20Education/Tasks/Installation)  
install the template

dotnet new --install “Litium.Accelerator.Templates”

create a new dir to install new accelerator  
run dotnet new litmvcacc in that dir from the terminal

**7.Edit host file**  
Since macOS doesnt have the [localtest.me](http://localtest.me) feature that Windows has I did add a [bookstore.localtest.me](http://bookstore.localtest.me) to the host file and hoping for the best.  
([How to Find the Hosts File on my Mac - Nexcess](https://help.nexcess.net/how-to-find-the-hosts-file-on-my-mac))

**8. Start the site**  
navigate to you Litium.Accelerator.Mvc project in a terminal and type:  
dotnet watch run  
The site appears to start, but i get an error message that i can’t connect to the database.

Litium version: 8.1

---

<div class="post-metadata">

**Author:** ![ton.nguyen](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/ton.nguyen/32/989_2.png) [@ton.nguyen](https://forum.litium.com/u/ton.nguyen)\
**Post date:** [December 17, 2021, 4:24pm UTC](https://forum.litium.com/t/developing-a-litium-8-site-on-macos/2361/2 "2021-12-17T16:24:37Z")

</div>

How did you install the database in step 6? Is there any issue? Since you don’t mention.

I am running Mac M1 and last time I tried, the only SQL image that supports M1 chips is the Azure Sql image, so you might want to try that one, or connect to a SQL instance from another machine.

---

<div class="post-metadata">

**Author:** ![Christian.Engvall](https://avatars.discourse-cdn.com/v4/letter/c/919ad9/32.png) [@Christian.Engvall](https://forum.litium.com/u/Christian.Engvall)\
**Post date:** [December 20, 2021, 2:27pm UTC](https://forum.litium.com/t/developing-a-litium-8-site-on-macos/2361/3 "2021-12-20T14:27:21Z")

</div>

I followed the docker task on Github to install it. I’m trying to “translate” those docs into something that works for macOS as well. This is the task: [Education/Developer Education/Tasks/Docker at main · LitiumAB/Education · GitHub](https://github.com/LitiumAB/Education/tree/main/Developer%20Education/Tasks/Docker) and these are the containers that gets installed, where sqlserver:2019-latest is referenced: [Education/docker-compose.yaml at main · LitiumAB/Education · GitHub](https://github.com/LitiumAB/Education/blob/main/Developer%20Education/Tasks/Docker/Resources/docker-compose.yaml)  
I did not run into any issue when installing the sql-container.

I’m not running on a M1-mac, but I could try the azure-container anyways.

It sounds like you have a Litium 8 site up and running on you mac?

---

<div class="post-metadata">

**Author:** ![ton.nguyen](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/ton.nguyen/32/989_2.png) [@ton.nguyen](https://forum.litium.com/u/ton.nguyen)\
**Post date:** [December 20, 2021, 2:44pm UTC](https://forum.litium.com/t/developing-a-litium-8-site-on-macos/2361/4 "2021-12-20T14:44:34Z")

</div>

Yes I got it up and running.

Where do you config the connection string? In appSettings or in App secrets? Also check the Sql instance to make sure it starts without any problem.

---

<div class="post-metadata">

**Author:** ![petterahlqvist](https://avatars.discourse-cdn.com/v4/letter/p/a3d4f5/32.png) [@petterahlqvist](https://forum.litium.com/u/petterahlqvist)\
**Post date:** [December 22, 2021, 4:46pm UTC](https://forum.litium.com/t/developing-a-litium-8-site-on-macos/2361/5 "2021-12-22T16:46:31Z")

</div>

We have been trying the same thing and get the same result as. Would love to know if you got it to work yet @Christian.Engvall

---

<div class="post-metadata">

**Author:** ![steve.redstorm](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/steve.redstorm/32/14_2.png) [@steve.redstorm](https://forum.litium.com/u/steve.redstorm)\
**Post date:** [December 22, 2021, 10:16pm UTC](https://forum.litium.com/t/developing-a-litium-8-site-on-macos/2361/6 "2021-12-22T22:16:14Z")

</div>

I got L8 Beta running on mac with Intel i7 in the summer.

---

<div class="post-metadata">

**Author:** ![petterahlqvist](https://avatars.discourse-cdn.com/v4/letter/p/a3d4f5/32.png) [@petterahlqvist](https://forum.litium.com/u/petterahlqvist)\
**Post date:** [December 27, 2021, 2:40pm UTC](https://forum.litium.com/t/developing-a-litium-8-site-on-macos/2361/7 "2021-12-27T14:40:30Z")

</div>

I finally got Litium up and running on macOS.

I think I found the reason behind the database not working. After looking at my Windows installation I saw that Docker Desktop adds three lines automatically to the hosts file which are:

{your machine ip} host.docker.internal  
{your machine ip} gateway.docker.internal  
127.0.0.1 kubernetes.docker.internal

Looking at my hosts file in macOS there is only one line added by docker and that is:

127.0.0.1 kubernetes.docker.internal

It is the above host name that is used when running litium db-tool hence it works when connecting. But for the ConnectionString in the MVC project the host name used is host.docker.internal which is not present. So by adding it to the hosts file I got it working. You could also use 127.0.0.1 directly in your appsettings I guess.

I also had problem with with setting up a valid dev certificate for \*.localtest.me so I ended up using localhost as DNS in my certificate instead and then it worked. I’m sure it is possible to setup a certificate for \*.localtest.me if you know what you’re doing. 😃

Hope this made sense and helped!

---

<div class="post-metadata">

**Author:** ![Christian.Engvall](https://avatars.discourse-cdn.com/v4/letter/c/919ad9/32.png) [@Christian.Engvall](https://forum.litium.com/u/Christian.Engvall)\
**Post date:** [January 13, 2022, 12:36pm UTC](https://forum.litium.com/t/developing-a-litium-8-site-on-macos/2361/8 "2022-01-13T12:36:58Z")

</div>

> [@petterahlqvist](#):
>
> {your machine ip} gateway.docker.internal

Cool, thanks for sharing. I’ve had a few weeks off but i’ll try it out when I get the chance!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex030/uploads/litium/original/1X/12eddac3b8b661de1db86af10ac8151b571e6fb9.png) [@system](https://forum.litium.com/u/system)\
**Post date:** [February 10, 2022, 12:37pm UTC](https://forum.litium.com/t/developing-a-litium-8-site-on-macos/2361/9 "2022-02-10T12:37:44Z")

</div>

Closed on February 10, 2022, 12:37pm UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
