There are a number of possibilities here. First of all, what type of weight are you gaining? Is it fat or lean mass? Although most people who embark on a ketogenic diet do so in order to lose “weight,” the diet is not a weight-loss diet, it is a weight-normalisation diet.
Firstly, I just need to point out that when we talk about “losing weight,” what we really mean is losing fat. Losing muscle and losing bone density are not good things, as I hope we can agree.
So one possibility is that your body feels a need to put on muscle or increase your bone density, and that would certainly throw off your scale reading. It is possible to add lean mass while simultaneously losing fat, as you can see. Bone and muscle are much denser than fat, of course, so another measure of progress might be how your clothes are fitting. If they feel looser, despite the increased poundage (or kilogrammage, as you prefer), then you are doing well, regardless of what your scale is telling you.
But in the event that your clothes are getting tighter, not looser, there are a few more things to try. For example, you might be more insulin-resistant than most people, so you might try cutting your carbohydrate intake even lower, to see if that helps. Eating more than a certain amount of carbohydrate in a day keeps insulin elevated, which prevents fat loss. The 20 g/day limit we propose on these forums is going to help almost everyone get into ketosis, but it is possible to be so insulin-resistant that even 20 g/day is too much. The good news is that insulin-resistance is reversible, so such a restriction of carb intake might not always be necessary. The other good news is that you might come to enjoy very low-car eating so much that you won’t want to increase your carb intake, even if you could.
Another thing to consider is whether you are eating enough. The metabolism adapts pretty quickly to whatever level of food we eat. If we skimp on calories, the metabolism slows down; if we eat a lot, the metabolism speeds up. (This is all within broad limits, of course.) On short rations, the body assumes there’s a famine going on, so it hangs onto its fat reserves, to get you safely through the hard times (the body will actually start to consume muscle before yielding up all of its fat, believe it or not). On abundant rations, the body starts to do all the things it wants, now that it has an ample budget, and can even start to waste energy. So the key to losing fat is, somewhat paradoxically, to give the body enough food for it to feel safe shedding its excess fat reserves.
Lastly, don’t fear fat. The principal hormone involved in causing the body to store and hold onto fat is insulin, which is greatly stimulated by carbohydrate in the diet. (This carbohydrate tends to get converted into fat and stored, by the way.) Protein has an effect on insulin, but the effect is a lot less when we eat very little carbohydrate (I’ll spare you the details, for now, because they are a bit complicated). Fat has almost no effect on insulin, so you can safely use as much as you want (within the broad limits I mentioned earlier) to satisfy your hunger. While insulin is necessary for us to be able to benefit from the food we eat (without it, we would starve to death), too much insulin is a Bad Thing and is to be avoided.