The Gandhi family originated from the village of Kutiana in what was then Junagadh State. In the late 17th or early 18th century, Lalji Gandhi moved to Porbandar and entered the service of its ruler, the Rana. Successive generations of the family served as civil servants in the state administration before Uttamchand, Karamchand's father, became diwan in the early 19th century under the then Rana of Porbandar, Khimojiraji. In 1831, Rana Khimojiraji died suddenly and was succeeded by his 12-year-old only son, Vikmatji. As a result, Rana Khimojirajji's widow, Rani Rupaliba, became regent for her son. She soon fell out with Uttamchand and forced him to return to his ancestral village in Junagadh. While in Junagadh, Uttamchand appeared before its Nawab and saluted him with his left hand instead of his right, replying that his right hand was pledged to Porbandar's service. In 1841, Vikmatji assumed the throne and reinstated Uttamchand as his diwan.
Karamchand had very little formal education, but his knowledge and experience made him a good administrator. He was said to be kind and generous, but also to have a bad temper.
Like his father, Uttamchand Gandhi, Karamchand had become a court official, or chief minister, of the local ruling prince of Porbandar. Karamchand's duties included advising the royal family of Porbandar and hiring other government officials.
Karamchand did not have a formal education. He learned from experience by watching his father work and attending religious ceremonies. There were some areas, however, in which he never gained much knowledge, including geography and history. Nonetheless, Karamchand excelled as chief minister in Porbandar.
In spite of Karamchand's success in his job, he did not find ways to accumulate wealth. The Gandhis had plenty to eat, a respectable number of servants, and a few nice pieces of furniture, but they were by no means wealthy. The money Karamchand brought in just covered the household expenses.
Karamchand married four times. His first three marriages ended with the deaths of his wives; among which two died immediately after giving birth to two daughters. He later married Putlibai Gandhi in 1859, and their marriage lasted till his death in 1885. This marriage produced four children - three sons and one daughter. Mahatma Gandhi was his youngest son. All his children got married during his lifetime.
In 1885, Karamchand suffered a serious attack of fistula. Putlibai and her children (especially Mohandas) took care of him. Though he was seriously ill, he still continued to go to the toilet on his own. His condition began to deteriorate day by day. Though doctors of every form of medical treatment treated him, no result was there. He later suggested a surgery for that, but his family doctor refused to do so. He had already bought some medicines for that, but they became useless. Karamchand lost the hope to life. Soon after, his condition deteriorated. Finally, he died on a dark windy night, aged 63. His son Mohandas (Mahatma Gandhi) later remembered this occasion like this: "That night, his uncle Tulsidas (Karamchand's younger brother) came to their home. Though death was imminent, no one accepted the fact that it would be his (Karamchand's) last night. When Tulsidas used to come to visit his ailing elder brother, he would sit behind him during day. That night, around 10:30 or 11, when then 16-year old Mohandas was pressing his father's neck, Tulsidas came there and told him to go. He happily went to his bed, where his wife Kasturba was sleeping. Within seconds, their servant called him and told that Karamchand's condition was serious. But as everyone had already realized that his condition was serious, they realized that he had died."