The suggestions about electrolyte supplements are good but also be sure that you are drinking enough water. Simple but easy to forget. When you first start keto the fast weight loss is usually “water weight”. You flush out (literally) a lot of electrolytes along with a lot of stored water from your tissues so you need to make sure you are replenishing both.
I’ve had very severe leg cramps and been looking for a solution for weeks. My functional medicine doctor gave me this advice:
Take an organic banana, take off any stickers, wash and cut off the ends. Boil it whole for 15 min (I boil with cinnamon and a couple of dashes of cayenne pepper). Take out the banana and drink the tea. Has more magnesium and potassium in the skin than in the fruit itself.
Homemade Electrolyte Drink
You could also make a homemade electrolyte drink of: 4 cups water, 1/2 cup fresh lemon juice, 1/4 cup raw honey, 1/4 tsp sea salt. Consume 1 cup at night before bed. (The rest will last a few days in the fridge.)
I tried both of these and then did them together. The severity of the cramps declined but did not stop. She gave me NOW potassium chloride which provides 365 mg in 1/8th tsp diluted in water. Nasty taste but it also helped some. Apparently tablets and capsules only have a max of 99 mg.
I also started taking Bone-up mineral capsules, but nothing consistently got rid of the cramps until I added ConcenTrace Mineral Drops to every bit of water I drink in a day. So I’m doing all of this, except the banana tea and homemade electrolyte drink. There’ve been now 4 or 5 mights without cramps, meaning finally a full night’s sleep, and once this pattern seems to be set I am going to start backing off the Bone-up caps until I see what dose still works for me.
I supplement KCl and Mg and use 5-6 different sea salts for sodium–one has iodine added, one is black, another gray, another the pink–each has some different micronutrients. I also have reduced cramps significantly by using very pure water–reverse osmosis. I found no success with the litany of mustard or pickle juice or supps which advertise to help muscle cramps–not even soap under my sheets helped as much as the water and electrolytes.
I tried all sorts of those things, the ONLY thing that stopped them was water. Lots and lots of water. I drink 16oz in one shot every two hours, often every 90 minutes even. And right before bed after turning the covers down I drink at least 24 ounces. (get in bed on your left side or it might come back up!) Bam. No nighttime legs cramps. It took my bladder about 2 weeks to adjust, but I usually don’t even wake for about 5-6 hours at night.