In the present work the adsorption of doxorubicin (DOX) on the surface of single-walled carbon nanotube (SWCNT) as well as its encapsulation in SWCNT, and their dependence on the protonation of NH2 group of DOX, solvent, and the diameter of armchair (n,n) SWCNT were systematically investigated using theoretical methods such as PM6-DH2 and M06-2X in the scheme of OMIOM. It was found that the two loadings, adsorption on the sidewall of CNT and the encapsulation in CNT, have distinct solvent, protonation and diameter dependences. The encapsulation is much stronger than the adsorption of DOX on the sidewall of CNT, and the former also has significantly higher solvent and protonation effects than the latter. The adsorption primarily occurs through π-π stacking and just becomes slightly stronger as the diameter of CNT increases, while besides π-π stacking the additional C-H/N-H/O-H…π and C=O…π also contribute to the encapsulation of DOX in CNT. It seems that (8,8) CNT (diameter ~ 11Å) energetically is an onset for the encapsulation since the encapsulation turns from endothermic to exothermic as the diameter is larger than approximately 11 Å, and the optimal diameter for the encapsulation is 14Å corresponding to (10,10) CNT. Thus for the thick CNT the encapsulation may also play an important role in the loading and releasing for the CNT-based drug delivery system of the DOX.