A common misconception is that you can gain muscle on a ketogenic diet.
From a scientific standpoint you need excess calories on top of your baseline caloric maintenance to gain.
First of all a ketogenic diet is very low in carbs and often times as low as 0 carbs. It is medium fat and high in protein.
It is a scientific fact that excess time on ultra high protein diets (over 2 grams of protein per lb) is not good and stressful on the kidneys.

So let us say your baseline metabolic caloric needs is 2,500 calories per day for maintenance. Well, if you are going keto let us say you are doing 50 grams of carbs per day. Since there is 4 calories per carb that is 200 calories from carbs right there. Let us say your fat is at 30 grams since there is 9 calories per gram of fat that is 270 calories from fat. So 200 calories from carbs + 270 calories from fat brings us to 470 calories between the two.

Now let us subtract our baseline 2,500 – 470 = 2,030 calories left that should essentially come from protein if you are just simply looking to maintain weight. Since there are 4 calories per gram of protein for entertainment purposes let us 2,030 / 4 = 507.5 gram of protein required to maintain.

In order for this not to be hard on your kidneys you would have to on the upper limit take max 2 grams of protein per lb of body weight so just to maintain your bodyweight on this type of diet you would have to take 507.5 grams of protein. Now if you are trying to gain on a keto diet (def almost impossible) you would have to bump your fat even higher as well as your protein and extended periods of time on high protein is simply not healthy on the kidneys.

So as you can see, a ketogenic diet is not sustainable, practical, nor healthy to be on when trying to add lean muscle tissue. It is only a tool to be used when trying to lean up which works rather well.I only post this because a female (maybe 120lbs) wanted a diet to gain muscle on but also to stay ketogenic. lol, it is just not practical, not only will she be miserable but so will her kidneys.
The best route for gaining muscle tissue is medium to high carb, medium protein, and low fat. (obviously would have to fit the required macros)
I love science because (assuming your hormones are healthy) you simply cannot fail with adjusting and changing your body’s composition at will.