Environmental pollution with non-steroidal anti-inflammatory drugs and their metabolites exposes living organisms on their long-lasting, damaging influence. Hence, the ways of non-steroidal anti-inflammatory drugs (NSAIDs) removal from soils and wastewater is sought for. Among the potential adsorbents, biopolymers are employed for their good availability, biodegradability and low costs. The first available theoretical modeling study of the interactions of diclofenac with models of pristine chitosan and its modified chains is presented here. Supermolecular interaction energy in chitosan:drug complexes is compared with the the mutual attraction of the chitosan dimers. Supermolecular interaction energy for the chitosan-diclofenac complexes is significantly lower than the mutual interaction between two chitosan chains, suggesting that the diclofenac molecule will encounter problems when penetrating into the chitosan material. However, its surface adsorption is feasible due to a large number of hydrogen bond donors and acceptors both in biopolymer and in diclofenac. Modification of chitosan material introducing long-distanced amino groups significantly influences the intramolecular interactions within a single polymer chain, thus blocking the access of diclofenac to the biopolymer backbone. The strongest attraction between two chitosan chains with two long-distanced amino groups can exceed 120 kcal/mol, while the modified chitosan:diclofenac interaction remains of the order of 20 to 40 kcal/mol.