Williams, who had not played a singles match since winning the 2017 Australian Open while pregnant, chalked up 27 unforced errors with 34 winners to defeat her 53rd-ranked opponent in front of a large and enthusiastic crowd in California. She said:
It was incredible. It’s been over a year and a kid later. I get to go home to her now and I’m excited about that. It definitely wasn’t easy but it was good. I’m a little rusty but it doesn’t matter. I’m just out here on this journey doing the best I can.
Williams was only two points from dropping the opening set but showed the sort of poise that has earned her 23 Grand Slam singles titles.
After taking a deep breath, she unleashed a second serve that kicked up viciously, forcing Kazakh Diyas to reach high for her return, unable to get it back into play.
Holding serve to level at 5-5, Williams broke in the next game, letting out a scream and clenching her left fist as Diyas netted.
The second set was a fairly even contest, with Williams again coming through on most of the big points.
The 36-year-old gave birth to daughter Alexis Olympia on September 1, but says post-childbirth health complications that included blood clots in her lungs were almost fatal.
She is now healthy again, but skipped this year's Australian Open because she did not consider herself tournament ready.
Williams is unseeded at Indian Wells, which is why she had to play the first round while the seeds, including sister Venus, enjoyed a bye. The Williams sisters could meet in the third round.
Serena plays Dutch 29th seed Kiki Bertens in the second round, while Venus takes on Romanian Sorana Cirstea.
Heather Watson made a first-round exit after going down 6-4 6-2 to Victoria Azarenka.
The Belarusian former world number one, playing her first WTA Tour match in eight months because she will not leave California due to an ongoing custody battle over her son, broke five times to Watson's two to book a second-round meeting with US Open champion Sloane Stephens.