Installation of decentralized water-treatment plants is an ideal option to supply safe drinking water for rural communities. Presently in Sri Lanka, over 3.6 million villagers face acute water-quality problems, and chronic kidney disease of unknown etiology (CKDu) is also prevalent among this community. Most of the drinking water in these villages is unpalatable due to high hardness and salinity. As an interim measure, reverse-osmosis (RO) water-treatment plants are introduced to provide safe water. However, due to deficient electrolytes, RO-treated water tastes unpleasant to some consumers; hence, people refuse it after prolonged use. The operation, maintenance, and management of RO plants are other major problems. Aimed at providing safe drinking water to the rural sector in a cost-effective manner, in this study, we fabricated an automated drinking-water purification system based on nanofiltration (NF) membrane technology, which can remove divalent cations, dissolved organic carbon (DOC) and pathogens efficiently, and monovalent ions partially, and thus keep electrolytes to some degree. Ten commercial NF membranes were tested in a laboratory, for solute and DOC removal efficiency and robustness. The DF-90 membrane showed the highest removal of DOC and hardness, and it was therefore selected, to design a pilot NF drinking-water treatment plant. The adhered DOC by the membrane can be cleaned by NaOH solution (pH = 12). The pilot NF drinking-water treatment plant has been in use since September 2018, and it shows excellent performance of removing DOC, TDS, hardness, fluoride, and pathogens in groundwater, and the permeate water of the NF plant has been well-accepted by the stakeholders of the society. The dominant genus of source water, and throughout the two processes (NF and RO), is Pseudomonas, and their difference is significant in the concentrates of the NF and RO processes.