The concept of minimal linear codes was introduced by Ashikhmin and Barg in 1998, leading to the development of various methods for constructing these codes over finite fields. In this context, minimality is defined as a codeword u in a linear code \(\mathcal {C}\) is considered minimal if u covers the codeword cu for all c in the finite field \(\mathbb {F}_{q}\) of order q but no other codewords in \(\mathcal {C}\) . A linear code \(\mathcal {C}\) is said to be minimal if each of its codewords is minimal. Minimal codewords are widely used in decoding linear codes, secret sharing schemes, secure two-party computations, cryptography, and other areas such as combinatorics. They have also facilitated the exploration of codes and research codes over finite commutative rings, which are considered appropriate alphabets for coding theory. Extending the minimality property from finite fields to rings and developing such codes poses significant challenges but presents opportunities for advancing coding theory in the context of finite rings. Firstly, the aim is to create graphs that produce a linear minimal (or nearly minimal) code through their adjacency, and examples will be offered for explicit illustrations. Secondly, there is an investigation of codes over rings generated by minimal codewords and an exploration of related minimal codes over finite chain rings. More specifically, a basis \(\mathcal {C}\) is constructed so that every codeword is minimal. To this end, a linear transformation of \(\mathcal {C}\) with this basis is built, and sufficient and necessary minimal linear codes over finite chain rings are provided. Then, there is a new design of minimality conditions over finite principal ideal rings.