The effects of dust charge polarity, ion temperature, and nonthermal electrons on dust-ion acoustic modulational instability and on the region (i.e., modulated wave number) for the formation of bright and dark envelope soliton structures are investigated. The dust particles are considered to be stationary and have positive and negative charges, while ions are taken dynamic and warm, and hot nonthermal electrons are assumed to be inertialess and kappa distributed in a dusty plasma. The Krylov–Bogoliubov–Mitropolsky method is used to derive the nonlinear Schrodinger equation (NLSE) for nonlinear amplitude modulation of dust-ion acoustic wave (DIAW) in plasmas. The dispersive and nonlinear coefficients of NLSE are obtained for DIAW, which depends on ion temperature, spectral indices of the nonthermal distributed electrons, dust density, and charge polarity of stationary dust particles. The modulationally stable and unstable regions of DIAW and its growth rate are investigated numerically. It is found that finite ion temperature, dust density, dust charge polarity, and spectral index of kappa for nonthermal electrons play a significant role to unstable the modulated DIAW modulated wave. The existence of positively and negatively charged dust particles and their observation in different regions of space plasma and in laboratory experiments is also pointed out.